HP-UX Reference (11i v3 07/02) - 1 User Commands N-Z (vol 2)
v
vi(1) vi(1)
NAME
vi, view, vedit - screen-oriented (visual) text editor
SYNOPSIS
vi [-][-l][
-r][-R][-t tag][-v][-V][-w
size][-x][-C][+command][file]...
UNIX Standard Synopsis
vi [-rR][-c command][
-t tag][-w size][file]...
Obsolescent Options
vi [-rR][+command][
-t tag][-w size][file]...
view [-][-l][
-r][-R][-t tag][-v][-V][
-wsize][-x][-C][+command][file]...
vedit [-][-r][
-R][-l][-t tag][-v][-V][-w
size][-x][-C][+command][file]...
Remarks
The program names
ex, edit,
vi, view, and vedit are separate personalities of the same program.
This manpage describes the behavior of the
vi/view/vedit personality.
DESCRIPTION
The
vi (visual) program is a display-oriented text editor that is based on the underlying
ex line editor (see
ex(1)). It is possible to switch back and forth between the two and to execute
ex
commands from within
vi. The line-editor commands and the editor options are described in ex(1). Only the visual mode com-
mands are described here.
The view program is identical to vi except that the readonly editor option is set (see ex(1)).
The
vedit program is somewhat friendlier for beginners and casual users. The report editor option is
set to 1, and the nomagic, novice, and showmode editor options are set.
In vi, the terminal screen acts as a window into a memory copy of the file being edited. Changes made to
the file copy are reflected in the screen display. The position of the cursor on the screen indicates the posi-
tion within the file copy.
The environment variable TERM must specify a terminal type that is defined in the
terminfo database
(see terminfo(4)). Otherwise, a message is displayed and the line-editor is invoked.
As with
ex, editor initialization scripts can be placed in the environment variable
EXINIT, or in the file
.exrc in the current or home directory.
Options
vi recognizes the following command-line options:
- Suppress all interactive-user feedback. This is useful when editor commands are
taken from scripts.
-l Set the lisp editor option (see ex(1)). Provides indents appropriate for
lisp code.
The
(, ), {, }, [[, and ]] commands in vi
are modified to function with lisp
source code.
-r Recover the specified files after an editor or system crash. If no file is specified, a list
of all saved files is printed. You must be the owner of the saved file in order to recover
it (superuser cannot recover files owned by other users).
-R Set the readonly editor option to prevent overwriting a file inadvertently (see
ex(1)).
-t tag Execute the tag tag command to load and position a predefined file. See the tag
command and the tags editor option in ex(1).
-v Invoke visual mode (vi). Useful with ex, it has no effect on vi.
-V Set verbose mode. Editor commands are displayed as they are executed when input
from a .exrc file or a source file (see the source command in ex(1)).
-wsize Set the value of the window editor option to size.Ifsize is omitted, it defaults to 3.
-x Set encryption mode. You are prompted for a key to allow for the creation or editing
of an encrypted file. This command makes an educated guess to determine whether
text read in is encrypted or not. The temporary buffer file is encrypted also, using a
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 391