editing macros
If you need to edit a macro (because you forgot to remember to add a motion key for the macro to be effectively repeatable):
:let @q="open theqregister<C-r><C-r>qpaste the contents of the q register into the buffer- ^ add the missing motion to return to the front of the line
- " add a closing quote
finish editing the macro
An alternate way of doing this is:
"qppaste the contents of the register to the current cursor positionIenter insert mode at the beginning of the pasted line- ^" add the missing motion to return to the front of the line and add a quote
return to normal mode "qyyyank this new modified macro back into theqregisterdddelete the pasted register from the file your editing
(Use ctrl+v <key> to get the actual character key for escape sequences for macros and whatever else)