PREV Improvements over Vi UP Improvements over Vi NEXT Undo and Backups

2.1: 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 Deleting Text), Change commands (see Changing Text), even Shell Commands (see Shell Commands) use these commands to describe a region of text to operate on. Thus, type dw to delete a word, >} to shift a paragraph, or !'afmt to format a region from `point' to textmarker `a'.

Viper 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 (i.e., the minimal contiguous chunk of full lines that contains the raw 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 Marking, for more info.

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

In the Overview chapter, some Multiple File issues were discussed (see Multiple Files in Viper). 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 `.viper' file. See Customization, for details.

PREV Improvements over Vi UP Improvements over Vi NEXT Undo and Backups