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:

① Due to the modal ways, you have to constantly switch mode. Solution is to make some easy key such as Alt or Caps Lock 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.

② 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.

terminal ADM-3A keyboard
terminal ADM-3A keyboard, where Bill Joy used to create vi. Note the arrows on {h j k l}. [see History of Emacs and vi Keys (Keyboard Influence on Keybinding Design)]

The origin of the choice of {h j k l} on that keyboard hardware is again by ease-of-implementation, not by design optimization. (See: History of Emacs and vi Keys (Keyboard Influence on Keybinding Design))

A better set of arrows is {i j k l}, forming a inverted T shape. [see Arrow Keys Layout Efficiency: vi's {H J K L} vs Inverted T {I J K L}]

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's 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)


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

Like it? Buy Xah Emacs Tutorial. Thanks.