Repeat Vim fold command (e.g. zfat: fold a tag)
Question
Is there a way to repeat a fold command I just executed? For example, say I am folding away a few tags with "zfat", how can I repeat the fold command I just executed without typing it again in its entirety?
Solution
Other option (besides mapping, as mention by lya):
qqzfatq
Now @q
repeats that. @@
repeats the last-used macro so you could actually do @@j@@j@@j@@
or similar to repeat more often.
Alternatively, you can include the motion (if it was necessary), for example assuming j
is the motion to move to the next tag to be folded:
qqzfatjq
Now, 10@q
folds 10 successive tags
OTHER TIPS
There is no easy way as long as I know. Maybe you can use macros or key mapping, i.g.
:map <F2> zfat
Then just press 'F2' to execute 'zfat'.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow