To enter an ex command from vi, use this form:
address is the line number or range of lines that are the object of command. If no address is given, the current line is the object of the command.
In ex command syntax, address can be specified by any of the following:
|All lines in the file.|
|Lines x through y.|
Lines x through y, with current line reset to x.
|Top of file.|
|Absolute line number n.|
|All lines; same as |
|n lines before x.|
|n lines after x.|
|One or n lines previous.|
|One or n lines ahead.|
|Line marked with x.|
|Ahead or back to line matching pat.|
In ex command syntax, options might be any of the following:
Indicates a variant form of the command, overriding the normal behavior.
The number of times the command is to be repeated.
count cannot precede the command, because
a number preceding an ex command is treated
as a line address.
deletes three lines beginning with the current line;
3d deletes line 3.
The name of a file that is affected by the command.
% stands for
# stands for previous file.