replay a vim macro until end of buffer

Kevin picture Kevin · Aug 18, 2009 · Viewed 25.8k times · Source

I want to run a macro I just recorded in register "x" on every single line of an open buffer, from my cursor to end of the buffer, in vim. How do I do that?

I know I can replay the macro n times:

15@x

...or just hold down @ until I reach the the last line, but I want to just hit a few keystrokes and be done with it.

Thanks in advance.

Answer

Randy Morris picture Randy Morris · Aug 18, 2009

Personally I would do

VG:normal @x

Edit: changed register to the one you specified.