Vi
- For other uses, see (disambiguation).
Vi can frustrate new users, because it is a modal editor. A modal editor (or any modal program) means that buttons or keystrokes have different meanings depending on which editing mode is currently active. The two major modes of editing in Vi are "insert" and "command" mode. In insert mode text typed is inserted into the document normally. Pressing the escape key while in insert mode will switch the Vi editor to command mode. When in command mode, each letter corresponds to a cursor movement or editing function (for example, "j" to move down a line, "k" to move up a line, "x" to delete a character, and "i" to return to insert mode). Keys pressed while in command mode are not inserted into the text, which is probably the most common cause for confusion among new users.
An advantage of having a separate command mode is that multiple editing operations can be performed in a row with very simple keystrokes, without having to hold down the
Early versions of vi didn't give any indication as to which mode they were in, and it is typical of users to simply press the Escape key to ensure the editor is in command mode (it will beep if already in command mode). Current versions of vi indicate the mode on the status line or graphically. Graphical implementations of vi (for example, Vim) also fully support the use of a mouse and menus to access editing commands.
Vi became the de facto standard Unix editor and a nearly undisputed hacker favorite outside of MIT until the rise of Emacs after about 1984. As of 2002 either vi or one of its clones can still be found on nearly all installations of Unix (the Single UNIX Specification specifies vi, so any system conforming to the Single UNIX Specification will have vi).
It is still widely used by users of Unix variants (about half the respondents in a 1991 USENET poll preferred it). It starts up faster than the bulkier versions of Emacs and uses less memory, consequently even some Emacs fans often resort to it as a mail editor and for small editing jobs. When a "rescue floppy" is being built for restores following a hard drive crash, vi is often the editor chosen because it is compact enough to fit on a floppy, and because almost anyone performing rescue operations will probably be able to use it.
Vi and Emacs are classically the two sides in the editor wars.
Vi was written in Evans Hall at the University of California, Berkeley.
