If I wanted to start recording a macro using command-line mode, how would I do this?

Additionally, if I wanted to bind this action to a key, how would I do that in my .vimrc?


For the first question

:normal! qa

That would start recording a macro to the "a" register. You may change that to any lower case letter.

To map F3 to it, for example, you could use

noremap <F3> :normal! qz<CR>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.