vi, vim, 3 Decades Pile of History

By Xah Lee. Date: . Last updated: .

spent a couple of hours looking at vim keys. It is, 3 decades pile of shit. Sorry, but truely.

i will never recommend emacs “evil-mode” again. (sometimes in past year i started to casually also recommend “evil-mode”, out of politeness with ergoemacs-mode .)

Actually, emacs isn't much better. Most default commands and keys are inefficient garbage. [see Why Emacs Keys are Painful]

if you just look at vi's {i, a, o} keys, you can see how inefficient and convoluted it is.

also, vim has p and P for paste. One pastes after the cursor, one pastes before. Ridiculous.

it's annoying but vi needs them because, when you move to end of line $, then press i to insert, it'll insert before the last char on the line. The $ really isn't moving to end of line, but to the position before the last char. (actually the whole thing is confusing, depending how you define “position”, as “between” chars, or “on” the char, and if “on the char”, you should have a consistent and universal useful way of always inserting before the position, or always after.)

there are several things wrong here. Better is:

(emacs is better here. It has one concept of “point” (aka cursor position), and the “point” is defined as the position between chars. The position before the first char is 1. Insertion commands always insert at “point”. )

also, vi's copy/cut is one screwball. First of all, it uses the obsolete terminology “yank”, yet its use of the term “yank” isn't compatible with emacs's. Vi's “yank” is modern “copy”, and emacs's “yank” is modern “paste”. (In vi , you “yank” into clipboard. In emacs , you “yank” from clipboard. (vi's clipboard is called “register”, while emacs's is called “kill-ring”. Emacs also has a “register”, but it's a separate storage area.) )

Note: it's not just hard to use, it is also utterly INEFFICIENT, despite myth.

vi and emacs are more powerful than typical IDE or editors, but their power came from the command line nature (a command is a function that process strings in a programable way.).

Given a editor with integrated command line system, both vi and emacs have the most INEFFICIENT keybindings.

also, vim has “v” or Ctrl+v for “visual mode”. What's vim's “visual mode”? It's somewhat like emacs's “mark”, but one inconsistent ball. (i think vi doesn't have concept of mark, and vim (Vi iMproved) invented this “visual mode” concept. So, you have this situation where you have a bag of commands each ad hoc do one thing with no concept of text selection (what emacs calls “region”), and when a new command is introduced in vim, it uses this “visual mode” concept to work on a region.)

there's no consistency to vim's keys neither. In vim, some commands are single key, some are with Shift, some are 2 keys, some involves Ctrl.

another tell-tale sign how vi is convoluted is to look at how to do search or find replace. Normally, the key : starts command, such as {:help, :set number, :syntax on, etc}. But there's also :8 to goto line 8, and :$ to goto end of file, and G is also goto end of file, then you have :s/regex/replace/flags to do find/replace, then you have :20,30s/aa/bb/gc to do between a range of lines. And you have :q for quit, and :w for write (save), and you can do both by:wq, but :help isn't made of 4 commands :h :e :l :p. Then, you have :q!, meaning quit without saving.

(in emacs, this is much better too. You have commands, and command may have keybinding. To call a command by name, press M-x. And, command has consistent mechanism of getting its arguments (arguments/parameters may specify behavior of the command, or which region to work on, or how many times to repeat, or user input (such as regex), etc.).)

if you look at vim's commands, say, from a to z and A to Z, and Ctrl+key, you'll find half of them redundant, and the semantics convoluted. It'd be more efficient to just have a set of a to z keys, and mapped to commands according to finger ease and the frequency the command is needed. Remove any keybinding with capital letter case, or reserve them to less used commands.

the last time i looked at vi seriously is around 1998. I found it intolerable. (i was a big GNU fanatic and unix-hater as captured in the acronym “Gnu is Not Unix”) Today, i thought of getting myself proficient with vim, but, now am not willing to proactively do so.

can vim be better? Sure, it can be much better, far more efficient. But, will vim throw away its backward compatibility? Likely not. Will vim throw away its outdated terminologies? No, because those are cuddly points of cult pride. Same with emacs.