简体   繁体   English

如何重复最后一个VIM宏?

[英]How can I repeat the last VIM macro?

I know how to repeat the last command in Vim. 我知道如何重复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. 这是一个有点不舒服,按@ q每次我想再说一遍。

I tried with . 我试过了 but it just repeats the last command from the macro. 但它只是重复宏的最后一个命令。

Is there a shorter way of doing that? 有没有更短的方法呢?

Yes, you can use @ @ to replay the last used macro. 是的,您可以使用@ @重播上次使用的宏。

As a bonus, use @ : to replay the last ex command. 作为奖励,使用@ 重播最后一个ex命令。 (And then that becomes the "last used macro" that can be repeated with @ @ .) (然后它成为可以用@ @重复的“最后使用的宏”。)

I find @ @ a bit hard to type and as I don't use , much - and it's close enough to . 我发现@ @有点难以输入,因为我没有使用,很多 - 而且它足够接近. :

:map , @@

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM