I talk about the age old battle between vim and emacs, and specifically where vim loses out, and how to help.
There’s one thing about Emacs that’s it’s “killer feature”, it’s the consistency of vision from start to end. The reason people call it an “operating system” is that it has abstractions so powerful that you can just build and build. Nothing else comes close to being as fully featured. We’ve seen things like Eclipse and Idea being good in a “special purpose” sense, but only because they’re effectively supported by corporations.
By contrast, vim is a mess. I say this as a vim guy and a maybe-intermediate vim user. It has one amazing, seductive trick up its sleeve, and that is the power of its grammar and movement. It’s a text meta-editor, and that makes it immensely powerful. I suspect that many vim users are drawn simply by this, and will go from beginner to expert without ever really getting past simply feeling guilty for not being ninja enough for vim.
Unfortunately the power of the grammar sits alongside the immensely clunky and frankly random layout, command sprawl, and variety of input methods. Vim is hard to use because it carries with it a boatload of legacy.
I’m not like that. I’m also not about minimising keystrokes like many vim users. I’m all about Actions Per Second. I’d prefer to press more keys if I can do it more comfortably and more quickly than having to remember more keypresses. To that end, I’ve started to think more deeply about vim’s central grammar, its usefulness, and how it can be improved.
Stage 1: More consistency
Most of the grammar is set up so that if you type a lowercase letter, it will do a thing in the forward direction. If you type an uppercase letter, it will do a thing in the backwards direction. A classic example is / to search forward, ? (shift-/) to search backwards. There are some exceptiont to this rule, and I’d like to remap the keys so it makes more sense.
' and 'Q': Currently, 'q' records a macro, 'Q' enters 'ex-mode', and '
' plays macros back. instead, ‘Q’ should play-back macros, and ‘@’ should enter ‘ex-mode’.All the shift number keys are now unbound except for ‘!’, ‘@’, ‘%’, and ‘&’. “Lost” functionality in the list above could potentially be restored by shoving it up there, but I doubt anyone would miss any of it.
Stage 2: Simplify and cleanup
Here, we remove some special purpose or non-forward thinking commands from the grammar. This is a little more “optional” because there’a a certain amount of “unused functionality isn't hurting anyone”, but I’m aiming for maximum simplicity. Controversially, I’m also proposing removal of ‘g’ and ‘z’ for extra commands. The idea is that you’re pressing an extra character anyway, why not just go all the way with ‘:’?
Stage 3: No ‘Ctrl’ key combos.
We already have commands, shift versions of those commands, and a handful of Ctrl commands. This is a lot to remember. Instead, the idea is that we remove all Ctrl-commands, and make it so the Ctrl-key is like a temporary push into command mode. Hitting Ctrl-x would be the same as typing ESC, x, i. This allows for entering commands and movements whilst in insert mode.
Stage 4: And nothing else
The idea is not to pollute the namespace. This would mean using only the given functionality in or implied by the commands as defined. The idea is to work like surround.vim, where we extend the grammar, but follow all its rules, such as using “cs” to mean “change surround”. Of course, the ex-cmd line ‘:’ would still be open slather. The file formats could redefine the meanings of words, sentences, and paragraphs, as well as good autoformatting. Plugins could “hook into” ‘g’ autocomplete or ‘z’ actions. And that’s it.
So there we have it, a simple, consistent grammar for vim in the 21st century. No cruft, clean extension points, and no (real) loss of power from a powerful movement and command system.