Vi
From Wikipedia, the free encyclopedia
- The correct title of this article is vi. The initial letter is shown capitalized due to technical restrictions.
vi is a screen-oriented text editor computer program written by Bill Joy in 1976 for an early BSD release.
Contents |
[edit] About vi
The name vi is an initialism derived from the shortest unambiguous abbreviation for the command visual in ex; the command in question switches the line editor ex to visual mode. The name is pronounced in various different ways; according to Eric S. Raymond, the correct pronunciation is /viː.aɪ/,[1] but other pronunciations such as /vaɪ/ are also used.[2]
Typically, as a matter of convenience, the same program will start up in vi or ex mode, depending on the name with which it is started.
vi is a modal editor and assigns different meanings to buttons or keystrokes depending on the active editing mode. In insert mode, text typed is inserted into the document. Pressing the escape key while in insert mode will switch the editor to command mode, where letters correspond to cursor movements or editing functions. For example: "j" to move the cursor down a line, "k" to move up a line, "x" to delete the character at the current cursor position, and "i" to return to insert mode. (Arrow keys also work, provided that vi knows the user's terminal type.) Keys pressed while in command mode are not inserted into the text, which is a common cause for confusion among new users.
In command mode, multiple editing operations can be performed in a row with simple keystrokes, without having to hold down the <Alt>, <Ctrl>, or other special modifier keys. More complicated editing operations are strung together from simple primitives (for example, "dw" to delete a word, or "c2fa" to change text from the cursor until finding the second "a"). For experienced users, this can lead to faster work. It also means that the user's hands never need to leave the keyboard.
Early versions of vi did not give any indication as to which mode they were in, and it is typical of users to simply press the Escape key to ensure that 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. Newer versions of vi also permit use of the PgUp, PgDn, Home, End and Del keys, provided that the terminal type has been correctly set (using the TERM environment variable). Graphical implementations of vi (for example, gvim) 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 2006 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.
vi is still widely used by users of Unix variants. About half the respondents in a 1991 USENET poll preferred vi. It starts up faster than the bulkier versions of Emacs and uses less memory. Consequently, even some Emacs fans will resort to it as a mail editor and for small editing jobs. In 1999, Tim O'Reilly, founder of the eponymous computer book publisher, stated that his company sold more copies of its vi book than its emacs book [1].
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 be able to use it.
vi and Emacs are classically the two sides in the editor wars.
[edit] Trivia
- vi was written in Evans Hall at the University of California, Berkeley, on a Lear-Siegler ADM3A terminal. On this machine, the Escape key was where the Tab key is nowadays, thus enabling users to very efficiently switch modes.
- David Hitz implemented a Turing machine simulator using vi macros[2].
- Internet Search Engine Snap.com created a search engine using a vi interface and commands called visearch.com webpage
[edit] Derivatives and clones
- vi is a port of the classic BSD vi 3.7 to modern Unix systems. It uses ed as a codebase, which is BSD-style free since January 2002. [3]
- nvi is an implementation of the ex/vi text editor originally distributed as part of the final official Berkeley Software Distribution(4.4BSD). This is the version of vi that is shipped with all BSD-based open source distributions. It adds command history and editing, filename completions, multiple edit buffers, multi-windowing (including multiple windows on the same edit buffer). Other than the
- Vim "Vi IMproved" is much like nvi. It is the standard version of vi on most Linux systems.
- Elvis is a free vi clone for Unix and other operating systems. This is the standard version of vi shipped on Slackware Linux and Kate OS.
- Vigor is vi with the addition of the Vigor Assistant, a deliberately irritating animated character modelled on Microsoft Office's Clippy.[4]
- vile was initially derived from an early version of Microemacs in an attempt to bring the Emacs multi-window/multi-buffer editing paradigm to vi users.
- bvi "Binary VI" is an editor for binary files based on the vi text editor.[5]
- viper-mode is a VI emulation mode for Emacs.
- svicc is a small vi clone for the Commodore (64) [6]
- BusyBox (a set of standard Linux utilities on a single executable) includes a tiny vi clone
- Yzis editor [7]
[edit] See also
[edit] References
- ^ Guy L. Steele, Eric S. Raymond (1996). in (ed.): The New Hacker's Dictionary, 3rd edition, MIT Press. ISBN 0-262-68092-0.
- ^ Gross, Christian (2005). Open Source for Windows Administrators. Charles River Media, p. 55. ISBN 1-584-50347-5.
[edit] Further reading
Oualline, Steve (2001) Vi IMproved - Vim, New Riders Publishers, 572 pp.
[edit] External links
- An Introduction to Display Editing with Vi original document
- vi lovers home page
- Western Orthodox Editors Page Softpanorama page about vi
- The vi Editor and its clones and programs with a vi like interface
- vi Editor Resources
- The interactive vi tutorial
- An introduction to the vi editor
- Quick vi tutorial
- The Semi-Official IBM developerWorks Vi-Cheat-Sheet
- The Register - "Bill Joy's greatest gift to man – the vi editor"
- vi is discussed on comp.editors
- vi Editor complete tutorial