Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)
vi(1) OSS Shell and Utilities Reference Manual
NAME
vi - Edits files
SYNOPSIS
vi [-ls][-R] | [-r][-c subcommand][-t tag][-wnumber][+subcommand][-][file ...]
The vi command is a display editor that is based on an underlying line editor (ex).
FLAGS
-c subcommand
Executes the specified ex subcommand (command) before displaying the file for which
the editor was invoked.
-l Indents appropriately for LISP code, and accepts the
(, ), {, }, [, and ] characters
(parentheses, braces, and brackets) as text rather than interpreting them as vi subcom-
mands. The LISP modifier is active in open or visual modes.
-r[file] Recovers file after an editor or system crash. If you do not specify a file, vi displays a
list of all saved files.
-R Sets the readonly option to protect the file against overwriting.
-s Invokes vi in open mode. (Silent mode.)
-t tag Edits the file containing the tag and positions the editor at its definition. To use this
flag, you must first create a database of function names and their locations using the
ctags command. OSS does not support the ctags command, however OSS vi does sup-
port ctags databases imported from other systems.
-wnumber
Sets the default window size to number. This is useful when you use the editor over a
low-speed line.
- Suppresses all interactive user feedback. If you use this flag, file input/output errors do
not generate an error message.
+[subcommand]
Performs the ex subcommand before editing begins. If you do not specify subcom-
mand, the cursor is placed on the first line of the file. (Obsolescent)
DESCRIPTION
The ex editor subcommands can be used within the vi editor, because vi is based on ex.(Fora
complete description of ex subcommands, see the ex reference page.) The file argument specifies
the files to be edited. If you supply more than one file on the command line, vi edits each file in
the order specified.
When you use vi, changes you make to a file are reflected on your display. The position of the
cursor on the display indicates its position within the file. The subcommands affect the file at the
cursor position.
Limitations of the vi Editor
The maximum limits of the vi editor are as follows:
• 2048 bytes per line.
• 256 bytes per global command list.
• 128 bytes in the previous inserted and deleted text.
10−2 Hewlett-Packard Company 527188-004