next up previous contents
Next: Changing Case Up: Advanced Editing and eve Previous: Basic vi Commands

Advanced vi Applications

Advanced editing applications handle more complex editor tasks like paragraph formatting, box editing, moving and duplicating large text sections, interaction with the shell, creation of temporary or reusable learning procedures and similar.

Most advanced applications are based on vi marker and buffer features that adhere to the following general syntax rules.


Marker and Buffer Syntax
syntax rules:
" buffer command ' marker
` marker1 command ` marker2
` marker1 " buffer command ` marker2
syntax items:
buffer and marker are single letters
use uppercase buffer to append new text to previous buffer contents
for markers use backquote for character position, quote for line addressing
command may be y or d single letter completed by marker


N.B. yank and delete commands are expressed as single letter when combined with the marker notation.

Let us examine in detail how vi processes the most complex syntax rule of the above Syntax table. The command is seen by vi as the combination of actions as follows:

1.
a go to action that moves the cursor exactly to the character pointed by the `marker1 (backquote notation)
2.
a buffer specification "buffer
3.
a compound command made by one of the following basic commands d, y suffixed by `marker2 that states the exact character position (backquote notation)

The result of the operation is the insertion of the text range delimited by the markers in the sepcified buffer with (d command ) or without (y command) deletion of the text range.

N.B. Marker notation is allowed only with one of the following double letter commands cw, cc, dw, db, dd, yw, yy where the second letter is replaced by the marker notation.

N.B. Marker range delimiters that involve also buffer management are meaningful only with delete or yank commands to fill the buffer.

Other complex editing features are achieved using ex mapping and abbreviation facilities or interacting with the shell by piping sub-units of the edited file like lines and paragraphs to filters or any user program that operates on stdin and stdout.



 
next up previous contents
Next: Changing Case Up: Advanced Editing and eve Previous: Basic vi Commands
Marisa Luvisetto
2000-12-20