I want to execute a set of independent(by this I mean which don't take each other as arguments) commands n times in vi (vim to be more precise). How can I group the commands? An example would be (I know it's a stupid command but I just want to illustrate my point):

80jl

How can I make vim execute both j and l commands 80 times? Is there a composition operator?

有帮助吗?

解决方案

You can record those commands using q and execute them using @, so:

qajlq

saves in register a the two movements, and:

80@a

execute 80 times the content of register a.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top