www.delorie.com/gnu/docs/emacs/viper_14.html   search  
 
Buy the book!


Viper Is a Package for Emacs Rebels

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 section 4.2.5 Deleting Text), Change commands (see section 4.2.6 Changing Text), even Shell Commands (see section 4.6 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 section 4.2.2 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 section 1.5 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 section 3. Customization, for details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)