The power of diff

Lots of people use vimdiff to understand and handle diffs in console mode. While there exist more specialized tools for comparing files, vimdiff has always worked well enough for me.

The inefficiency of the external diff

However, Vim’s diff mode was seriously lacking. This was basically because it needed to write down temporary files, shell out and run a manual diff command and parse the result back and as one can imagine, this could be slow and was seriously inefficient.

Additionally, this required to have a diff binary available that was able to create ed like style diff, so one could not even fall-back to using git-diff (which is considered to have one of the best tested diff libraries and allows to select different algorithms) for creating those diffs. This lead to the creation of vimscript plugins, that would internally translate a unified diff back into an ed-like diff. Of course this would add an extra performance penalty.

Read more…

【译】Atom 新的并发友好型 buffer 实现

Atom 的一些功能依赖于缓冲区(buffer)内容基础上的运算(可能会花费很长时间),但是直到最近,还只能从运行在主线程上的 JavaScript 访问缓冲区的文本。这使得无法在所有情况下保证 Atom 的响应能力,尤其是在编辑较大文件时。

这种情况随着 Atom 1.19 的发布而有所改变,该版本通过使用 C++ 实现的文本存储极大地提高了并行处理能力。这项新设计为性能和可伸缩性提供了诸多好处,其中主要优点之一是 worker 线程可以读取之前缓冲区的快照(snapshot),而不会阻塞主线程上的写入。在这篇文章中,我们将深入介绍 Atom 的文本存储新方法,然后探讨由此带来的首批优化。

Read more…

【译】重新实现 Text Buffer

Visual Studio Code 1.21 发行版包含一个全新的 text buffer(文本缓冲区)实现,无论在速度还是在内存使用方面,该实现都更加出色。在本文中,我想讲一下我们是如何选择/设计数据结构和算法以实现这些提升的。

Read more…

在浏览器中运行 Vim 编辑器

有人将 Vim 编辑器移植到了 WebAssembly (Wasm) 格式: vim.wasm: Vim Ported to WebAssemblyWasm 是一种底层的二进制指令格式,理论上能实现接近 C/C++/Rust 等编译性语言的执行速度,目前已经在主流浏览器 Chrome/Safari/Firefox/Edge 中得到支持。所以现在,你可以在浏览器上体验原汁原味的 Vim 了!

vim.wasm on chrome

Read more…

Vim Cheatsheet
Contents © 2019 ashfinal - Powered by Nikola