VI(1) — Silicon Graphics
NAME
vi, view − screen oriented (visual) display editor based on ex
SYNOPSIS
vi [ −t tag ] [ −r ] [ +command ] [ −wn ] name ...
view [ −t tag ] [ −r ] [ +command ] [ −wn ] name ...
DESCRIPTION
Vi (visual) is a display oriented text editor based on ex(1). Ex and vi run the same code; it is possible to get to the command mode of ex from within vi and vice-versa.
Vi puts up a screenful of text at a time (unless a smaller window is specified) and allows rapid and fluid cursor motion to the place where you want to begin adding, changing, or deleting text. With vi, editing can be done on characters, words, lines, or sections at a time. When multi-character changes are made, it is necessary to hit the ESCAPE key to return to cursor motion mode.
View is an invocation of vi which disallows writing. View is useful for browsing through a file when no modifications are intended.
Using ex commands and calling up the Shell by typing (!) are done with a colon (:) and the appropriate command sequence, such as that to find a string or write the file.
The Vi Command Summary (below), the Vi Quick Reference card and the Introduction to Display Editing with Vi provide full details on using vi.
The following options are recognized:
−t Equivalent to an initial tag command, editing the file containing the tag and positioning the editor at its definition.
−r Used in recovering after an editor or system crash, retrieving the last saved version of the named file. If no file is specified, a list of saved files will be reported.
+command indicates that the editor should begin by executing the specified command. If command is omitted, then it defaults to $, positioning the editor at the last line of the first file initially. Other useful commands here are scanning patterns of the form "/pat" or line numbers, e.g., "+100" to start at line 100.
−wn sets the default window size to n, and is useful in dialups, to start in small windows.
Name arguments indicate files to be edited.
Vi Command Summary
Cursor Motion:ForwardBack
letter(space)^H, h
word right-limitE,e
word left-limitW,wB,b
sentence)(
paragraph}{
section/function]][[
line: same/limit$0
1st charac+,<ret>-
same column^n,LF^p
specified <line#>G<line#>G
1/2 screenful^d^u
screenful^f^b
Undoing Errors (see also: change, insert, delete)
uundo last change
Urestore current line
"Npretrieve Nth last delete
<esc>abandon incomplete command (without completing it)
:q!drastic! abandon without saving.
InsertChange
ibefore cursorcw<newword>change word to newword
Ibefore 1st non-blankCchange rest of line
aafter cursorssubstitute character
Aat end-of-lineSsubstitute lines
oopen line belowrxreplace 1 character
Oopen line aboveRreplace characters
<esc>terminates insertxptranspose character
<esc>terminates change
DeleteDelete during Insert
xcharacterlast charac^H
X...before cursorlast word^W
dwwordall input this line@
de...but leave punctuation
ddline
(#)ddnumber of lines
Drest of line
FILES
See ex(1).
EXAMPLE
vi text
would invoke the editor with the file named "text". For further examples, see An Introduction to Display Editing with Vi.
SEE ALSO
ex(1)
Vi Quick Reference card, An Introduction to Display Editing with Vi.
AUTHOR
William Joy
Mark Horton added macros to visual mode.
BUGS
Software tabs using ^T work only immediately after the autoindent.
Left and right shifts on intelligent terminals don’t make use of insert and delete character operations in the terminal.
The wrapmargin option can be fooled since it looks at output columns when blanks are typed. If a long word passes through the margin and onto the next line without a break, then the line won’t be broken.
Insert/delete within a line can be slow if tabs are present on intelligent terminals, since the terminals need help in doing this correctly.
Saving text on deletes in the named buffers is somewhat inefficient.
The source command does not work when executed as :source; there is no way to use the :append, :change, and :insert commands, since it is not possible to give more than one line of input to a : escape. To use these on a :global you must Q to ex command mode, execute them, and then reenter the screen editor with vi or open.
Version 3.6 — December 20, 1987