Fast Typing: Text Editors
This post is not some fluff piece asking a dumb question like “is NucleusSuperEditor better than editing bytes with a chisel” and then rattling off a bunch of irrelevant information like “editing bytes with a chisel uses less ram but NucleusSuperEditor supports gifs”.
No, in this post, we’ll think deeply about text editing so we know not only which text editor to use, but when we’re forced to use a text editor, how to use it effectively. This is essential for fast typing because you’ll spend more time talking to your editor than your wife.
What is "vi"?
A lot of people say they use vi. But they use "vim" or "elvis" or "neovim". So when they say "vi", they clearly don’t mean the original vi program written in 1976 by Bill Joy. They mean they use the vi text editing convention. When using "vi" (and in normal mode), they mean that they quit with :q!, not that Bill Joy wrote the code.
So what vi is a convention.
If we think of text editing as defined by a piece of software, and we want to use a fast editor on arbitrary text fields, we need to transfer text between the editor and arbitrary text fields. Some people do this with copy and paste and some programs do this by running the program specified in the EDITOR or VISUAL environment variables.
If we think of text editing as defined by a convention, then other programs can implement the convention. This doesn’t just mean “vi” clones, but plugins and “modes”. Even emacs supports vi via viper.
What conventions are there?
There’s popular ones three: default, vi and emacs. There are numerous others but vi/emacs are good enough that they’re popularity makes up any efficiency improvements. Popularity matters because it means there’s tons of online support for your convention, so you can quickly google a question or download a package to solve a problem.
What conventions should I use?
Everybody: Default
Most text fields support the default conventions. Anything you heard of as a “shortcut” applies here, for example this reference from How-To-Geek covers them. You should also remap home/end/page up/page down/delete or buy a kinesis advantage which has these keys under your thumb.
This is much less expressive than vi or emacs, but sometimes it’s all you have, so fluency in these shortcuts will increase your text editing speed.
Mac Users: basic emacs
mac users also have some emacs keybindings supported in all text fields which is a major improvement from the default convention. As such, learning basic emacs commands will benefit a mac users.
Sysadmins: vi
If you’re doing sysadmin work, logging into multiple machines, it’s more likely a machine you’re working on will support vi than emacs, so you must know vi.
Everybody: vi or emacs
This debate is old and I’m not going to resolve it. Try both, and stick with the one you like better.
What editor should you use?
Use an editor you like that supports the convention you like. Sublime, VSCode, Atom, IntelliJ, and Notepad++ all have a vi or emacs plugin. Whether you use them with a plugin or “vim/emacs” doesn’t matter much. The main thing to watch out for is incomplete or sluggish plugins. If you find yourself using one, switch to another editor. If they’re all bad, then you should use standalone vim/emacs.
Conclusion
As we’ve seen, there’s two parts to text editing. There’s the text editing convention and then the software that accepts it. The vi/emacs conventions are widely supported on many editors. You should use the convention (between vi/emacs) and editor that you like best (or have to use). Nobody knows if vi or emacs is better.
Next week, we’ll discuss how to use vi effectively. If you don’t want to miss out, it takes a second, just click Subscribe now below.