O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Editing macros

Macros are stored in registers (the same ones used by yank and paste operations). You can view the contents of all your registers by executing :reg:

Close to the middle of the list you can see "a, the register containing our macro. You can also view the contents of, say, register a by executing :echo @a.

In the preceding screenshot, many special characters are represented differently. For instance, ^[ signifies the Esc key, and ^M is an Enter key.

In fact, macros are nothing but registers: the q command lets you add keystrokes to the register, while @ lets you replay the keystrokes from that register.

Since the macro is just ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required