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

Basics

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, ', [[, ]], []

If a point command is given as an argument to a modifying command, the region determined by the point command will be affected by the modifying command. On the other hand, if a line command is given as an argument to a modifying command, the region determined by the line command will be enlarged so that it will become the smallest region properly containing the region and consisting of whole lines (we call this process expanding the region), and then the enlarged region will be affected by the modifying command. 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. Thus dw to delete a word, >} to shift a paragraph, or !'afmt to format a region from `point' to textmarker `a'.

VIP adds the region specifiers `r' and `R'. Emacs has a special marker called mark. The text-area between the current cursor position point and the mark is called the region. `r' specifies the raw region and `R' is the expanded region. dr will now delete the region, >r will shift it etc. r,R are not motion commands, however. The special mark is set by m. and other commands. See section Marking, for more info.

VIP also adds counts to most commands for which it would make sense.

In the Overview chapter, some Multiple File issues were discussed (See section Multiple Files in VIP). In addition to the files, Emacs has buffers. These can be seen in the :args list and switched using :next if you type :set ex-cycle-through-non-files t, or specify (setq ex-cycle-through-non-files t) in your `.emacs' file. See section Customization for details.


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