man.bsd.lv manual page server

Manual Page Search Parameters

VI(1) General Commands Manual VI(1)

vi, viewscreen 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.

Available options:

Read only. Changes to the file may not be written out.
Sets options for editing LISP source (options showmatch and lisp).
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.
tag
If tags are used (see ctags(1)) the editor is positioned at tag.
n
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.

User specified startup values for ex and vi. Usually specified in the file ~/.exrc
Default directory to search for the file ~/.exrc
Shell used for commands (with the ex :! command).
Terminal type used to lookup terminal capabilities from the file /usr/share/misc/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), environ(7)

Vi Quick Reference Card.

An Introduction to Display Editing with Vi.

Software tabs using 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.

The vi command appeared in 3.0BSD.

BSD 3 December 30, 1993 VI(1)