How can I remap the vim record macro key from 'q' to 'Q'?

vim

Solution

You can remap Q to quit and q to no command in two command lines Like this:

nnoremap Q q
nnoremap q <Nop>

Problem

Sometimes I accidentally enter vim's record macro mode by pressing 'q' (which I usually get out of by pressing q two more times.) What are the commands to change the keybinding to start recording a macro from 'q' to 'Q'? I can stop 'q' from doing anything by setting ``` nnoremap q <Nop> ``` but I'm not sure how to get 'Q' to be the record macro shortcut.

Original source