vi editing a temporary, empty file. Tildes signify lines not present in the file. vi is a free software screen-oriented text editor written by Bill Joy in 1976 for an early BSD release. Updated screen shot of VIM running in the Gnome Terminal on Ubuntu Linux. ...
Updated screen shot of VIM running in the Gnome Terminal on Ubuntu Linux. ...
Clockwise from top: The logo of the GNU Project (the GNU head), the Linux kernel mascot Tux the Penguin, and the FreeBSD daemon Free software is a term coined by Richard Stallman and the Free Software Foundation[1] to refer to software that can be used, studied, and modified without...
Notepad is the standard text editor for Microsoft Windows A text editor is a piece of computer software for editing plain text. ...
Bill Joy William Nelson Joy (born Nov 8, 1954), commonly known as Bill Joy, is an American computer scientist. ...
Year 1976 Pick up sticks(MCMLXXVI) was a leap year starting on Thursday (link will display full calendar) of the Gregorian calendar. ...
Berkeley Software Distribution (BSD, sometimes called Berkeley Unix) is the Unix derivative distributed by the University of California, Berkeley, starting in the 1970s. ...
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. (Ex was a Unix editor that could switch between visual and command-line modes - the command line mode was to maintain some backward compatibility with an even earlier Unix editor called ed. The name vi 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] Acronyms and initialisms are abbreviations formed from the initial letter or letters of words, such as NATO and XHTML, and are pronounced in a way that is distinct from the full pronunciation of what the letters stand for. ...
ex, short for EXtended, is a line editor for Unix systems. ...
A line editor is a text editor computer program that is oriented around lines. ...
ex, short for EXtended, is a line editor for Unix systems. ...
ex, short for EXtended, is a line editor for Unix systems. ...
ed was the original standard text editor on the Unix operating system. ...
Eric S. Raymond (FISL 6. ...
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.
Modal Editing vi is generally understood to be a modal editor: it operates in either insert mode (where typed text becomes part of the document) or command mode (where keystrokes are interpreted as commands that control the edit session). Typing 'i' while in command 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 command mode.) In computer software, a mode is distinct method of operation within a computer program, in which the same user input can produce different results depending of the state of the computer. ...
The Esc key is a key labeled Esc or Escape that is used to generate the ASCII Escape character, the character code traditionally used to initiate an escape sequence. ...
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. After processing the third character, vi changes state and begins processing input as text to be added to the file. On processing the excape, vi returns to the state in which it is ready to receive a new command. Whether viewed as modal-ness or stateful-ness, the fact that vi processed the same keystroke in different ways depending on the history of the edit session distinguishes it from editors which are generally considered non-modal. An 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 command 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.
Operation Upon start-up, vi starts in command mode (unless instructed otherwise). Typing 'i' (the letter 'i' without the quotes) enters insert mode. Any text typed thence gets added to the document, until the escape key is pressed, at which point the insert mode is exited and vi switches to command mode. (There are few more commands that switch the editor into insert mode, but they differ only in where the new text will go - before the cursor, after the cursor, above current line, below current line, etc.).
Vi Commands There are too main classes of commands: cursor movements and text modification. Vi is the fullscreen counterpart to ex, and cursor movement is a key part of the design.
Motions These commands move the cursor, either relative to its current position, or to an absolute position. Relative motions can be prefixed with a count, to tell vi to repeat the motion. These are relative motion commands: - h j k l - Move the cursor to the left, down, up, right, respectively. These also take a count: '8l' moves the cursor 8 letters to the right.
- <Ret> + - - Move the cursor down (<Ret> and '+') or up ('-').
- w W b B - Move forward ('w' and 'W') or back ('b' and 'B') by a word. 'w' and 'b' treat anything non-alphanumeric as a word delimiter; 'W' and 'B' honor only white space.
- } { - Move to end of current or previous paragraph, respectively.
- ) ( - Move to end of current or previous sentence, respectively.
Absolute motions do not accept a count except for special cases where it acts as a line or column number. These are absolution motion commands: - G - Go to (a specified line). E.g., "10G" moves the cursor to line 10. Without a count, vi goes to the last line of the buffer.
- ^ - Move to first nonblank character on the current line.
- $ - Move to end of current line.
- 0 - Move to beginning of current line.
Operators Many of the text modification commands form a special category known as operators. They can be prefixed with a count (to repeat the operator), and are suffixed with a motion command. The text between the current position and the final position (after the motion) is called a region. These are examples of operators: - d - delete a region. "d10G" deletes lines from current line until line 10 (inclusive). Recall that "10G" moves the cursor to line 10.
- c - change a region. "cwnew"<Esc> - changes current word with the text 'new'. Note that "cw" essentially switches the editor to insert mode.
- < > - indent a region. "<)" indents left all the lines from here until end of paragraph. ">/xxx" indents right lines from here until the line containing the pattern "xxx".
In some instances, if the motion command repeats the operator character (as in 'dd'), the region is a whole line. Thus "dd" deletes the current line, and "ccnew<Esc>" replaces the entire current line with the text 'new'. Prefixing it with a count repeats (or makes it apply to more than one), e.g., "10dd" deletes 10 lines.
Inline Commands A few commands move the cursor only within the current line. Like operators, they accept a repeat count: - fletter - Move the cursor to the first occurrence of letter in the current line, starting from current position.
- Fletter - Similar to 'f', but in the reverse direction.
- tletter - Move the cursor before the first occurrence of letter in the current line, starting from current position.
- Tletter - Similar to 't', but in the reverse direction.
- ; - Repeat the last forward scan.
- , - Repeat the last reverse scan.
Other Commands Other commands do not fall neatly into a category: - /pattern - Search for pattern and place the cursor at the start of the matched text.
- ?pattern - Search in the reverse direction.
- % Move the cursor to the matching brace or bracket {} [] ().
- . Repeat the last command which has modified the file. This may be used in a map, for example, suppose one has substituted an underscore for a space as the last command: <escape>:map g j0. will set a macro-command g to perform the last . command after moving to the first column in in a line (0) and then down one line (j). From then on, one may simply press the g key to repeat the last command.
- ! - Filter a region through an external program. "!Gsort" pipes all the lines from current line to the end of the document ('G') to the 'sort' program and replaces those lines in the document with the output of the sort program.
Regular Expressions Support for regular expressions (or text patterns) is an important feature of vi. These can be used extensively in search, substitution and global search and replace commands.
Ex Commands All of the ex commands can be used in vi by typing ":" to get a prompt, and entering the command. Exit temporarily (or permanently) from visual mode to ex by "Q", return to visual mode by ":vi".
Options Several of vi's default behaviors can be altered using options. These take the form ":set option" or ":set nooption" and so on. Example: "set ignorecase" causes all searches to be case-insensitive.
File Commands - :w filename - Writes (saves) the current document. If the optional filename is provided, the text is saved in the specified file.
- :q - Quits the editor.
- :e filename - Loads the specified file into the editor.
- :n - Loads the next file into the editor. Useful when vi was invoked from the command line with multiple file names.
- :r filename - Reads (inserts) the content of the specified file into the current document.
Where applicable, these commands take a line number or a range of line numbers. E.g., "10,25w newfile" will write lines 10 through 25 (inclusive) into the file newfile; "$r newfile" will read the contents of file newfile after the last line of the current document ('$' stands for the last line).
Maps and Abbreviations A frequently used command sequence can be mapped to a new command-letter. The sequence could even include any text to be inserted. E.g.,: map * iAuthor: John Bull<Esc> causes the '*' character to be a command that inserts "Author: John Bull" at the cursor position. An abbreviation is like a mapping, but during insert mode. Example: abbr US United States This will insert "United States" whenever the word "US" is typed when in insert mode.
Miscellaneous The above provide a flavor of vi commands, and are obviously not the complete set.
History 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. Also, the keys h,j,k,l had arrows, explaining the usage of these keys for moving around. The ADM3A had no other keys that corresponded to arrows. Image File history File links This is a lossless scalable vector image. ...
Image File history File links This is a lossless scalable vector image. ...
Evans Hall is the mathematics, statistics, and economics building at the University of California, Berkeley, situated at the northeast corner of campus, just east of Memorial Glade. ...
Sather tower (the Campanile) looking out over the San Francisco Bay and Mount Tamalpais. ...
The ADM-3A is one of the first computer terminals manufactured by Lear-Siegler. ...
A computer terminal is an electronic or electromechanical hardware device that is used for entering data into, and displaying data from, a computer or a computing system. ...
HJKL keys are a method of navigating a cursor around the screen in console program without using arrow keys or numpad. ...
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 2007 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. De facto is a Latin expression that means in fact or in practice. It is commonly used as opposed to de jure (meaning by law) when referring to matters of law or governance or technique (such as standards), that are found in the common experience as created or developed without...
Filiation of Unix and Unix-like systems Unix (officially trademarked as UNIX®) is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs including Ken Thompson, Dennis Ritchie and Douglas McIlroy. ...
Hacker, as it relates to computers, has several common meanings. ...
The Massachusetts Institute of Technology (MIT) is a private, coeducational research university located in Cambridge, Massachusetts. ...
Emacs is a class of text editors, possessing an extensive set of features, that are popular with computer programmers and other technically proficient computer users. ...
Year 1984 (MCMLXXXIV) was a leap year starting on Sunday (link displays the 1984 Gregorian calendar). ...
2007 is a common year starting on Monday of the Gregorian calendar. ...
The Single UNIX Specification (SUS) is the collective name of a family of standards for computer operating systems to qualify for the name Unix. The SUS is developed and maintained by the Austin Group, based on earlier work by the IEEE and The Open Group. ...
vi is still widely used by users of Unix variants. About half the respondents in a 1991 USENET poll preferred vi.[1] 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]. Year 1991 (MCMXCI) was a common year starting on Tuesday (link will display the 1991 Gregorian calendar). ...
Usenet (USEr NETwork) is a global, decentralized, distributed Internet discussion system that evolved from a general purpose UUCP architecture of the same name. ...
Tim OReilly at the MIX06 conference in Las Vegas, Nevada Tim OReilly (born 1954, Cork, Ireland) is the founder of OReilly Media (formerly OReilly & Associates) and supporter of the free software and open source movements. ...
Derivatives and clones
The startup screen of vi clone vim - 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. [2]
- 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 nvi, 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 and Kate OS.
- Vigor is vi with the addition of the Vigor Assistant, a deliberately irritating animated character modelled on Microsoft Office's Clippy.[3]
- 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.[4]
- viper-mode is a VI emulation mode for Emacs.
- svicc is a small vi clone for the Commodore (64) [5]
- BusyBox (a set of standard Linux utilities on a single executable) includes a tiny vi clone
- Yzis provides all vi features in a library which in turn is used by several frontends (Qt,KDE, curses) for all main operating systems (Unix, Windows, MacOS X) [6]
Image File history File links No higher resolution available. ...
Image File history File links No higher resolution available. ...
Vim, which stands for Vi IMproved, is an open source, multiplatform text editor extended from vi. ...
ed was the original standard text editor on the Unix operating system. ...
Berkeley Software Distribution (BSD, sometimes called Berkeley Unix) is the Unix derivative distributed by the University of California, Berkeley, starting in the 1970s. ...
nvi (new vi) is a re-implementation of the classic Berkeley editor, ex/vi, traditionally distributed with BSD, and later, Unix systems. ...
Vim, which stands for Vi IMproved, is an open source, multiplatform text editor extended from vi. ...
HTML syntax highlighting Syntax highlighting is a feature of some text editors that displays textâespecially source codeâin different colors and fonts according to the category of terms. ...
Linux (IPA pronunciation: ) is a Unix-like computer operating system. ...
Elvis is a powerful vi/ex clone, i. ...
Slackware is a Linux distribution. ...
Kate OS logo Kate OS II running XFCE Kate OS is a Linux distribution with multitasking features, made specifically for multimedia use. ...
This article lacks information on the importance of the subject matter. ...
Clippy asking if you need help. ...
vile is a text editor that attempts to combine the best aspects of the popular Emacs and vi editors. ...
Emacs is a class of text editors, possessing an extensive set of features, that are popular with computer programmers and other technically proficient computer users. ...
The British Virgin Islands are a group of islands located in the northeast Caribbean. ...
Emacs is a class of text editors, possessing an extensive set of features, that are popular with computer programmers and other technically proficient computer users. ...
BusyBox is a software application which provides many standard Unix tools, much like the larger (but more capable) GNU Core Utilities. ...
See also Image File history File links This is a lossless scalable vector image. ...
The following is a list of text editors. ...
This article provides a basic feature comparison for several text editors. ...
In hacker culture, the editor war is an ongoing debate in the computer programming community about which text editor is best for general-purpose editing. ...
Emacs is a class of text editors, possessing an extensive set of features, that are popular with computer programmers and other technically proficient computer users. ...
This is a list of Unix programs. ...
References - ^ a b 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.
Eric S. Raymond (FISL 6. ...
Further reading Oualline, Steve (2001) Vi IMproved - Vim, New Riders Publishers, 572 pp.
External links |