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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005