vi.1 (2010 09)

v
vi(1) vi(1)
in ex (1)).
-C Encryption option. Same as the -x option, except that all text read in is assumed to
have been encrypted.
-c command (Under UNIX Standard only, see standards (5))
+command (Obsolescent) Begin editing by executing the specified
ex command-mode com-
mands. As with the normal
ex command-line entries, the
command option-
argument can consist of multiple
ex commands separated by vertical-line com-
mands (|). The use of commands that enter input mode in this manner produces
undefined results.
file Specify the file or files to be edited. If more than one file is specified, they are pro-
cessed in the order given. If the
-r
option is also specified, the files are read from
the recovery area.
(Under UNIX Standard only, see standards (5)) If both the
-t tag and -c command (or the obsolescent
+command) options are given, the -t
tag will be processed first, that is, the file containing the tag is
selected by
-t and then the command is executed.
When invoked,
vi is in command mode. input mode is initiated by several commands used to insert or
change text.
In input mode, ESC (escape) is used to leave input mode; however, two consecutive ESC characters are
required to leave input mode if the
doubleescape editor option is set (see ex(1)).
In command mode, ESC is used to cancel a partial command; the terminal bell sounds if the editor is not
in input mode and there is no partially entered command.
WARNING : ESC completes a "bottom line" command (see below).
The last (bottom) line of the screen is used to echo the input for search commands (
/ and ?), ex com-
mands (
:), and system commands (!). It is also used to report errors or print other messages.
The receipt of
SIGINT during text input or during the input of a command on the bottom line terminates
the input (or cancels the command) and returns the editor to command mode. During command mode,
SIGINT causes the bell to be sounded. In general the bell indicates an error (such as an unrecognized
key).
Lines displayed on the screen containing only a
˜ indicate that the last line above them is the last line of
the file (the ˜ lines are past the end of the file). Terminals with limited local intelligence might display
lines on the screen marked with an @. These indicate space on the screen not corresponding to lines in
the file. (These lines can be removed by entering a ˆR, forcing the editor to retype the screen without
these holes.)
If the system crashes or
vi aborts due to an internal error or unexpected signal, vi attempts to preserve
the buffer if any unwritten changes were made. Use the
-r command line option to retrieve the saved
changes.
The
vi text editor supports the SIGWINCH signal, and redraws the screen in response to window-size
changes.
Command Summary
Most commands accept a preceding number as an argument, either to give a size or position (for display
or movement commands), or as a repeat count (for commands that change text). For simplicity, this
optional argument is referred to as count when its effect is described.
The following operators can be followed by a movement command to specify an extent of text to be
affected: c, d, y, <, >, !, and =. The region specified begins at the current cursor position and ends just
prior to the cursor position indicated by the move. If the command operates on lines only, all the lines
that fall partly or wholly within this region are affected. Otherwise the exact marked region is affected.
In the following description, control characters are indicated in the form
ˆX, which represents Ctrl-X.
Whitespace is defined to be the characters space, tab, and alternative space. Alternative space is the first
character of the ALT_PUNCT item described in langinfo (5) for the language specified by the LANG
environment variable (see environ (5)).
Unless otherwise specified, the commands are interpreted in command mode and have no special effect in
input mode.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010