I accidentally hit qq
instead of @q
, and my vim is now recording into register q
.
If I type q
again, it will overwrite the previously recorded macro.
Is there a way to either
Solve the problem and record the macro To record a macro and save it to a register, type the key q followed by a letter from a to z that represents the register to save the macro, followed by all commands you want to record, and then type the key q again to stop the recording.
It means you're in "record macro" mode. This mode is entered by typing q followed by a register name, and can be exited by typing q again.
By default*, the l command is such a command, so you can use it to stop a recursive macro. If the cursor is not at the end of the line, then you just need to move it back afterwards with the command h .
QQ is a wrapper over curl for making remote calls inside vim.
You can back the macro up into a different register:
:let @a=@q
Then the previous macro will be stored in register a, and available to be run as @a
.
I just found a less direct way of doing the thing same thing too, also based on the observation that the macro is not recorded until the second q
.
I simply use "qp
to paste the macro somewhere, and then use "qyy
to yank it back in after I cancel the recording.
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