One of Vim's most useful features is its ability to record what you type for later playback. :help recording This is most useful for repeated jobs which cannot easily be done with ".".

To start recording, press q in normal mode followed by a letter (a to z). That starts recording keystrokes to the specified register. Vim displays recording in the status line. Type any normal mode commands, or enter insert mode and type text. To stop recording, again press q while in normal mode.

To playback your keystrokes, press @ followed by the letter previously chosen. Typing @@ repeats the last playback.