8.1.4. Syntax of vi Commands
In vi, commands have the following general form:
[n] operator [m] object
The basic editing operators are:
c | Begin a change. |
d | Begin a deletion. |
y | Begin a yank (or copy). |
If the current line is the object of the operation, the object
is the same as the operator: cc, dd, yy.
Otherwise, the editing operators act on
objects specified by cursor-movement commands or
pattern-matching commands.
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 can represent any of the following text blocks:
word | Includes characters up to a whitespace character
(space or tab)
or punctuation mark.
A capitalized object is a variant form that recognizes
only whitespace.
|
sentence | Is up to ., !, or ?, followed by two spaces. |
paragraph | Is up to next blank line or paragraph macro defined by
the para= option.
|
section | Is up to next section heading defined by the sect= option. |
2cw | Change the next two words. |
d} | Delete up to next paragraph. |
d^ | Delete back to beginning of line. |
5yy | Copy the next five lines. |
y]] | Copy up to the next section. |