61

I know how to repeat the last command in Vim. I use ..

But how can I repeat the last macro? It's a little non-comfortable to press @q everytime I want to repeat it.

I tried with . but it just repeats the last command from the macro.

Is there a shorter way of doing that?

Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474

2 Answers2

89

Yes, you can use @@ to replay the last used macro.

As a bonus, use @: to replay the last ex command. (And then that becomes the "last used macro" that can be repeated with @@.)

benjifisher
  • 5,054
  • 16
  • 18
john
  • 1,156
  • 9
  • 22
9

I find @@ a bit hard to type and as I don't use , much - and it's close enough to .:

:map , @@
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
Goblinhack
  • 2,859
  • 1
  • 26
  • 26