on vi Keybinding vs Emacs Keybinding

By Xah Lee. Date: . Last updated: .

Here's a keybinding design for vi. It is based on the principle that most frequently used commands be placed on the most easy-to-press keys.

[ErgoVim Key Mappings By Harrison Ainsworth. At http://www.hxa.name/articles/content/ergovim-key-mappings_hxa7241_2010.html , accessed on 2013-06-15 ]

At one point in my hand health crisis, i was planning to do this in emacs.

vi is a great alternative to healthy keys, but, there are 2 major issues:

(1) Due to the modal ways, you have to constantly switch mode. Solution is to make some easy key such as Alt or CapsLock send Escape key signal. [see Vim: How to Remap Escape Key?]

The modal way is actually efficient, and the reason for that is because, half of the time the keys pressed by programers are editing commands, not data entry. (according to emacs key statistics[see Emacs's Command Frequency]) This means, for every command call (such as moving cursor or deleting text), you press a single key instead of a key combo, it'd saves you significant amount of finger strain.

(2) vi keys is by historical happenstance, just like emacs. There is absolutely nothing about it being ergonomic. Most of its keys are simply mnemonic, like emacs. For example, $ for moving to end of line (which came from the regex $ for matching end of line.) And the famous vi arrows the {H J K L}, came from the terminal hardware.

[see History of vi Keys]

The origin of the choice of H J K L on that keyboard hardware is again by ease-of-implementation, not by design optimization.

A better set of arrows is {I J K L}, forming a inverted T shape.

[see Arrow Keys Arrangement Efficiency: vim HJKL vs IJKL]

Solution is to design a ergonomics based modal key mode. So that, the most frequently used commands, by statistics, are assigned to the most easy-to-press keys (such as home row keys). Also, vim has many key baggage. Many commands have more than one keybinding, and there is no consistency. (vimers will claim consistency, but that's more like after-the-fact grafted philosophy.)

But, if you don't type that much as data-entry clerks do, it doesn't really matter. It's good enough. [see How Many Keystrokes Programers Type a Day?]

Also note, the modal way being efficient, isn't out of vi's design. vi happened to be so-called modal, because back in 1980s, you interact with computer by giving a command, then tell the computer to update screen, thus the “command mode” and “insertion mode”. That's why, as late as 2008, in emacs manual, emacs still introduce itself as “real-time DISPLAY editor” — it updates the screen as you type. (see bottom of: GNU Emacs and XEmacs Schism (2001))


I actually created a ergonomics based modal key mode. Been using it for over a year now. Splendid. See: Emacs: Xah Fly Keys 📦.