vim Macros Editing a vim macro

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Sometimes you will make a mistake with a lengthy macro, but would rather edit it than re-record it entirely. You can do this using the following process:

  1. Put the macro on an empty line with "<register>p.

    If your macro is saved in register a, the command is "ap.

  2. Edit the macro as needed.

  3. Yank the macro into the correct register by moving the cursor to the beginning of the line and using "<register>y$.

    You can re-use the original register or use another one. If you want to use register b, the command is "by$. or by using "<register>d$ (deletes the unused line)



Got any vim Question?