This section provides a review of the following:
Syntax of vi commands
Once the file is opened, you are in command mode . From command mode, you can:
Invoke insert mode
Issue editing commands
Move the cursor to a different position in the file
Invoke ex commands
Invoke a Unix shell
Save the current version of the file
In insert mode, you can enter new text in the file. You
normally enter insert mode with the
i command. Press the ESCAPE key to exit
insert mode and return to command mode. The full list of commands
that enter insert mode is provided later, in the section "Insert Commands."
In vi, editing commands have the following general form:
The basic editing operators are:
Begin a change.
Begin a deletion.
Begin a yank (or copy).
If the current line is the object of the operation, the
motion is the same as the operator:
yy. Otherwise, the editing
operators act on objects specified by cursor-movement commands or
pattern-matching commands. (For example,
cf. changes up to the next period.)
n and m are the number of
times the operation is performed, or the number of objects the
operation is performed on. If both n and
m are specified, the effect is
n × m.
An object of operation can be any of the following text blocks:
Includes characters up to a whitespace character (space or tab) or punctuation mark. A capitalized object is a variant form ...