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.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004