DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Editing files

Repeating and undoing commands

To repeat the last insertion or deletion command, type a dot (.); the last action will then repeat. For example, to delete three lines, go to command mode and type:

dd..

The dd command deletes a line, and each period repeats the command.

You can tell vi to carry out a command a number of times by first entering the number, then the command. For example, to delete five lines starting with the line the cursor is on, enter the command 5dd. Type u to undo this command. Type u again to undo the undo.


Next topic: Including the contents of another file
Previous topic: Confirming substitutions

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003