Vim macros

Updated: 30 June 2025

  1. Type qn to record a macro into register n.
  2. Type q to stop recording the macro.
  3. Type @n to run the macro in register n.

The list of commands which make up the macro are stored in the n register. If the macro needs to be edited, paste it with "np. Then, after editing, select it and copy back into the register with "ny.

Leave a comment