Ph: 9780596529833

vi

From Wikipedia, the free encyclopedia

Jump to: navigation, search
vi

vi editing a temporary, empty file. Tildes signify lines not present in the file.

vi is a screen-oriented text editor written by Bill Joy in 1976 for an early BSD release.

The name vi is 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 vi is pronounced /ˈviËˈaɪ/,[1] or /vaɪ/.[2]

Current releases of vi are free and open source software, usually released under permissive free software licenses such as the BSD License.

[edit] Interface

vi is a modal editor: it operates in either insert mode (where typed text becomes part of the document) or normal mode (where keystrokes are interpreted as commands that control the edit session). Typing i while in normal mode switches the editor to insert mode. Typing i again at this point places an "i" character in the document. How the i keystroke is processed depends on the editor mode. From insert mode, pressing the escape key switches the editor back to normal mode.

vi can process compound commands that embed text for insertion in the document. For example, the command:

20iHello world! Enter Escape

would insert 20 lines in the document with the text Hello world!. Rather than grapple with the notion of two mode switches while executing this command, some users view vi as a stateful filter.[citation needed] After processing the third character, vi changes state and begins processing input as text to be added to the file. On processing the escape, vi returns to the state in which it is ready to receive a new command.

Whether viewed as modal or stateful, vi's processing of the same keystroke in different ways depending on the history of the edit session distinguishes it from editors which are generally considered non-modal.

A perceived advantage of a modal editor is that the use of keyboard chords (multiple keys pressed simultaneously, typically a modifier plus a letter key) is reduced or eliminated. Instead, in normal mode, single keystrokes serve as commands. This results in the user's hands not having to take up awkward positions, which some find results in faster work.[citation needed]

[edit] History

ADM3A keyboard layout

vi was derived from a sequence of UNIX command line editors, starting with ed. ed was enhanced to become em,[citation needed] then en.[citation needed] At the University of California, Berkeley, Bill Joy enhanced em to create ex, including the addition of a visual mode. Eventually it was observed that most ex users were spending all their time in visual mode,[citation needed] and Joy created a direct entry command called vi.

Joy used a Lear-Siegler ADM3A terminal. On this terminal, the Escape key was at the location now occupied by the Tab key on the widely-used IBM PC keyboard (on the left side of the alphabetic part of the keyboard, one row above the middle row). This made it a convenient choice for switching vi modes. Also, the keys h,j,k,l served double duty as cursor movement keys and were inscribed with arrows, which is why vi uses them in that way. The ADM3A had no other cursor keys.

In 1979,[citation needed] Mark Horton took on responsibility for vi.[citation needed] Horton added support for arrow and function keys, macros,{cn}} and improved performance by replacing termcap with terminfo. In 1983,[citation needed] vi was added to Bell Labs System V and has not significantly changed since.

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. The Single UNIX Specification specifies vi, so every conforming system must have it.

vi is still widely used by users of the Unix family of operating systems. About half the respondents in a 1991 USENET poll preferred vi.[1] In 1999, Tim O'Reilly, founder of the eponymous computer book publishing company, stated that his company sold more copies of its vi book than its emacs book.[3]. It should, however, be noted that in comparison to vi, Emacs comes with a more extensive help library and a built-in tutorial.


[edit] Derivatives and clones

The startup screen of vi clone vim
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). Vim "Vi IMproved" has yet more features than vi, including (scriptable) syntax highlighting, mouse support, graphical versions, visual mode and many new editing commands. 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, Kate OS and MINIX. 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. BusyBox, a set of standard Linux utilities on a single executable, includes a tiny vi clone. Viper, an emacs package providing Vi emulation on top of Emacs.

[edit] See also

[edit] References

^ a b Raymond, Eric S; Guy L. Steele, Eric S. Raymond (1996). (ed.). ed.. The New Hacker's Dictionary (3rd edition ed.), MIT Press. ISBN 0-262-68092-0.  ^ Gross, Christian (2005). Open Source for Windows Administrators, Charles River Media. pp.55. ISBN 1-584-50347-5.  ^ "Ask Tim Archive". O'Reilly (June 21 1999).

[edit] Further reading

Lamb, Linda; Arnold Robbins (1998). Learning the vi Editor (6th Edition), O'Reilly & Associates, Inc, http://www.oreilly.com/catalog/vi6/.  Robbins, Arnold; Linda Lamb, Elbert Hannah (2008). Learning the vi and Vim Editors, Seventh Edition, O'Reilly & Associates, Inc, http://oreilly.com/catalog/9780596529833/.  Oualline, Steve (2001) Vi IMproved - Vim, New Riders Publishers, 572 pp.

[edit] External links

Wikibooks
Wikibooks has more on the topic of


You are viewing a mobilized version of this site...
View original page here

How do you rate mobile version of this page?

Mobilized by Mowser Mowser