VI(1) BSD Reference Manual VI(1)
vi, view - screen oriented (visual) display editor based on ex
vi [-R] [-l] [-r] [-t tag] [-w n] [+command] name ...
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.
View is the same as ``vi -R'', e.g. run in read-only mode.
-R Read only. Changes to the file may not be written out.
-l Sets options for editing LISP source (options showmatch and
-r In the event of an editor or system crash, the -r option will
retrieve the last saved version of the specified file, or if
no file is specified, a list of saved files is printed.
-t tag If tags are used (see ctags(1)) the editor is positioned at
-wn The default window size is set to n.
+command Enter the file with command. Useful for positioning on a
string or line number.
The Vi Quick Reference card and the Introduction to Display Editing with
Vi provide full details on using vi.
The vi command uses the following environment variables.
EXINIT User specified startup values for ex and vi. Usually speci-
fied in the file ~/.exrc
HOME Default directory to search for the file ~/.exrc
SHELL Shell used for escaped commands (with the ex :! command).
TERM Terminal type used to lookup terminal capabilities from the
TERMCAP If set, specifies an alternate termcap file.
/usr/libexec/ex?.?strings error messages
/usr/libexec/ex?.?recover recover command
/usr/libexec/ex?.?preserve preserve command
/usr/share/misc/termcap describes capabilities of terminals
~/.exrc editor startup file
/tmp/Exnnnnn editor temporary
/tmp/Rxnnnnn named buffer temporary
/var/preserve preservation directory
awk(1), ed(1), grep(1), sed(1), grep(1), vi(1), termcap(5), envi-
Vi Quick Reference Card.
An Introduction to Display Editing with Vi.
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 intelli-
gent 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 reen-
ter the screen editor with vi or open.
The vi command appeared in 3.0BSD.
3rd Berkeley Distribution December 30, 1993 2