Appending to macros
Sometimes, you’ll record a macro and then think to yourself “damn — I forgot to do this small thing at the end”. If this happens, you don’t have to re-record the entire macro. You can append additional steps to the macro by recording to the uppercase register where it’s stored!
So, if your macro was originally recorded with qa, you can re-enter recording mode but append to the macro that you recorded previously with qA.
This is useful for the common situation where you only need to make a small change at the end of the macro’s sequence of actions.
Try it in the editor. Work through the checklist below. Record a macro into the "a register that prefixes the line with XXX, and replay it on the second line. Then, append to the macro with qA — this time adding XXX to the end of the line — and replay it once more on the last line. You’ll see that the final replay includes the steps from both of the recording sessions. Nice!