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:
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.