Go to the first, previous, next, last section, table of contents.


The VI command set is based on the idea of combining motion commands with other commands. The motion command is used as a text region specifier for other commands. We classify motion commands into point commands and line commands.

The point commands are:

h, l, 0, $, w, W, b, B, e, E, (, ), /, ?, `, f, F, t, T, %, ;, ,, ^

The line commands are:

j, k, +, -, H, M, L, {, }, G, ', [[, ]], []

Text Deletion Commands (see section Deleting Text.), Change commands (see section Changing Text.), even Shell Commands (see section Shell Commands) use these commands to describe a region of text to operate on.

VIP adds the two region descriptors, r and R. These describe the Emacs regions (see section Basics), but are not movement commands.

The command description uses angle brackets `<>' to indicate metasyntactic variables, since the normal conventions of using simple text can be confusing with VIP where the commands themselves are characters. Watch out where < shift commands and <count> are mentioned together!!!.

`<move>' refers to the above movement commands, and `<a-z>' refers to registers or textmarkers from `a' to `z'. Note that the `<move>' is described by full move commands, that is to say they will take counts, and otherwise behave like normal move commands. `<address>' refers to Ex line addresses, which include

. <No address>
Current line
.+n .-n
Add or subtract for current line
Actual line number, use .= to get the line number
Last line
Where x and y are one of the above
For the whole file, same as (1,$).
/pat/ ?pat?
Next or previous line with pattern pat

Note that `%' is used in Ex commands to mean current file. If you want a `%' in your command, it must be escaped as `\%'. Similarly, `#' expands to the previous file. The previous file is the first file in :args listing. This defaults to previous window in the VI sense if you have one window only.

Others like `<args> -- arguments', `<cmd> -- command' etc. should be fairly obvious.

Common characters referred to include:

Return, Enter

We also use `word' for alphanumeric/non-alphanumeric words, and `WORD' for whitespace delimited words. `char' refers to any ascii character, `CHAR' to non-whitespace character. Brackets `[]' indicate optional parameters; `<count>' also optional, usually defaulting to 1. Brackets are elided for `<count>' to eschew obfuscation.

The usual Emacs convention is used to indicate Control Characters, i.e C-h for Control-h. Do not confuse this to mean the separate characters C - h!!!. The ^ is itself, never used to indicate a Control character.

Go to the first, previous, next, last section, table of contents.