重播 vim 宏直到缓冲区结束

我想运行一个宏,我刚刚在注册表“ x”中记录了一个打开的缓冲区的每一行,从我的光标到缓冲区的结束,在 vim。我该怎么做?

我知道我可以重放宏 n 次:

15@x

... 或者按住 @直到我到达最后一行,但我只想敲击几下键盘,然后就完事了。

先谢谢你。

32609 次浏览

999999@x, unless you have a very large buffer...

make recursive macro:

qa@aq

ex:

qa0gUwj@aq

It'll UPCASE first word from current line to the end of file with single @a. But make sure "a register is empty:

let @a=""

You can do (in command mode)

:%normal @x

Personally I would do

VG:normal @x

Edit: changed register to the one you specified.

From vim wiki, shortened version: qqqqq to record the macro @qq to finish recording @q to execute it (and will run till end of the file)