I recorded a macro to a register and started it with too many repetitions. It takes way to much time to complete each macro.
How do I cancel/stop Vim executing macro? Is there a way by doing it without killing editor process?
Here are the steps I followed:
1000@1
Use Ctrl-O to temporarily get into normal mode, the “q” to quit recording. This is the same thing you'd do if already in Insert mode and want to start recording a macro into register “a”; Ctrl-O, then “qa”.
In Normal Mode , you can also press ZZ or ZQ to quit Vim. Where ZZ is the same as :x and ZQ is the same as :q! .
In Vim, a macro is a feature that allows you to record a sequence of commands that you use to perform a given task. You then execute that macro many times to repeat the same job in an automated way.
C-c works
Also, you can let it break on error. (which, I think, is the default). I sometimes temporarily do
:se nowrapscan
to avoid "infinitely" looping over my buffer
Also, to speed up macro execution, make it silent:
:silent! norm 1000@q
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With