I've noticed vim can be pretty intuitive, but I'm having trouble finding a way to repeat the second-to-last command (or third-to-last, fourth-to-last, etc.). By typing .
in normal mode it will repeat the last command. Pressing 3.
will repeat the last command three times.
Let's say I type oHello<Esc>
then A, World!<Esc>
. I now get
Hello, World!
on the screen. Now, say I want to get
Hello, World!
Hello
Hello
Hello
without typing Hello. Does vim store the history beyond one command, so I could type something like 3,2.
(i.e. repeat the second-to-last command three times)?
qaoHello<esc>q
then@a
to repeatHello
whenever you want.) There's also@@
to repeat the last used macro.3@a
to repeat the macro multiple times