Vim - The ubiquitous text editor

Vim is one of the most widely used text editors in the Linux realm, featuring compact keybindings, modal editing, and a huge number of extensions.


The name of Vim derives from "Vi IMproved", i.e., it it meant to enhance the existing vi editor.

The concept of Vim, inherited from vi, is all geared towards efficiency in the editing. For example, many operrations require just one keystroke.

Some of the main characteristics of Vim include:

  • modal editing: the functions associated to keys change depending from the current editing mode;
  • compact keybindings: in normal mode, the most common editing functions are associated to one single key, making the editing very speedy; this includes the motion of the cursor, with the famous association of Left, Up, Down and Right motions to the h, j, k and l keys, respectively.
  • incredible customizability, from keybindings to themes (colors), from syntax highlighting to almost every aspect of the editor;
  • macro recording, which makes it efficient the execution of repeated operaetions on different portions of text.

In the following example, a macro is recorded to look for a comma in the text and turing it into a full stop followed by a capitalized word. Once recorded, the macro is applied to the remaining text.

Vim's plugins can be programmed in the vimscript language (VimL), although in recent years the support for other languages has been introduced, with Python playing an important role in the implementation of recent plugins.

Vim is known to have a steep learning curve, which means that it takes some non-negligible effort to get acquainted with its editing characteristics. However, once the main features are known, the user can appreciate the superb ergonomy of the program. On the other hand, mastering a large amount of features may take a long time, although many of such features may not be required for the everyday usage.


References