NAME
vi, view —
screen oriented (visual) display editor
based on ex
SYNOPSIS
vi |
[-R] [-l]
[-r] [-t
tag] [-w
n]
[+command]
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.
View is the same as “vi -R”,
e.g. run in read-only mode.
Available options:
-R- Read only. Changes to the file may not be written out.
-l- Sets options for editing LISP source (options
showmatchandlisp). -r- In the event of an editor or system crash, the
-roption will retrieve the last saved version of the specified file, or if no file is specified, a list of saved files is printed. -ttag- If tags are used (see ctags(1)) the editor is positioned at tag.
-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.
ENVIRONMENT
The vi command uses the following
environment variables.
EXINIT- User specified startup values for
ex and
vi. Usually specified 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 file /usr/share/misc/termcap.
TERMCAP- If set, specifies an alternate termcap file.
FILES
- /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
SEE ALSO
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.
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.
HISTORY
The vi command appeared in
3.0BSD.