Line Tagging

This is the simpler form and allows you to tag lines in their entirety. The selected operation applies to the whole line. For example, to delete a block of lines you would locate the first line in the series to be deleted and press the F7 key. The line is displayed in reverse-video to indicate that it has been tagged. F7 is another toggle key which sets/removes a tag, hence the line could be "untagged" by pressing F7 again. This is a more complex toggle which is also tied into block tagging, and you should pause about one second before depressing the key again to untag a line.

Now move the cursor and tag the last line to be deleted using F7. You will notice that all of the lines to be deleted in between the tagged lines now show up as inverse-video. When you set two tags, all lines between the two tagged lines are treated as a tagged block. To perform the actual delete, press the F8 key (the tag operation key). This key will prompt you for a command and typing a "d" will delete all the lines as a block. The deleted lines can be restored as a block using the CtrlF1 or CtrlF2 (probably a CtrlF2 since you would want to insert them before the current line).

You will find that if you delete lines one at a time the editor will restore them one at a time and if you delete them as a block they will be restored as a block. This is explained in detail in the Reference section.

The tagging of lines may also be used as a method for moving and copying blocks of lines. The F8 key has five functions:

d
(delete, already explained)
m
(move)
k
(kopy)
s
(save)
p
(print lines on $lpt)

To try the move option, find a small block of text and tag the first and last lines using the F7 key. Move the cursor to another place in the text, press F8 and respond to the prompt with an "m". The tagged block of text will be appended after the current cursor line.

The kopy option is analogous to the move option. Tag a block of lines using the F7 keys. Move to the desired location, press F8, enter a "k" when prompted and the lines will be copied after the current cursor line. The original tagged block of text remains unchanged.

The save option will save the tagged lines into the file "/tmp/group.user", where group is your current numerical group ID and user is your numerical user ID. The saved text may be restored later using the ShiftF8 key. Selecting a line paste (l) will insert the text before the line your cursor is on. You may save and restore text between different edit sessions and/or consoles.

The F4 (fill) and CtrlF4 (center) keys will operate on tagged lines if any have been set. If not they default to the range indicated on the section describing them.

Some things to remember when using tags: