Registers and macros

This post brings information from a few places to provide a rundown of registers and macros in Vim.

Registers

There are a few special registers

Registers are persisted in the ShaDa file. We can ignore it by starting Neovim with nvim -i NONE.

Macros

Macros are recordings of keystrokes that we can replay. We can record a macro by pressing q in normal mode and specifying one letter to refer to our macro.

For example, qm starts recording macro m. We can stop recording a macro by pressing q again. Now, we can run this macro by pressing @m.

Why am I talking about macros? Macros are stored in Vim registers. Our macro is stored as text in register "m, We can "mp to paste. Edit it. Load back with "myy".

Moodboard