Macros
What is mostly called a macro in vim is initiated with @ and a letter. It executes the contents of a register with the said letter as its name.
List the register contents
:reg
You can clear the register a with
:let @a = ''
Sometimes mappings or abbreviations are confused for macros, therefore here is some information about them.
List mappings
all mappings
:map
all mappings that start with \
:map \
normal mode
:nmap
insert mode
:imap
visual mode
:vmap
command mode
:cmap
List abbreviations
all abbreviations
:abbr
all abbreviations starting with email
:abbr email
insert mode
:iabbr
command mode
:cabbr
You can use :verbose
before the previous commands to get more info about where the mapping/abbreviation was last set, as in :verbose nmap
. These commands also show all the mappings that have been set by plugins and other configuration files.
Removing a mapping/abbreviation
(only a couple of modes listed here, you should be able to remove one just for a certain mode just like with the listing commands above.)
insert mode, remove a mapping that is defined as \:
:iunmap \\
normal mode:
:nunmap \\
remove an abbreviation defined as email:
:unabbr email
insert mode:
:iunabbr email
Clear mappings/abbreviations
I wouldn't recommend clearing all mappings/abbreviations since you would lose everything your plugins have mapped/abbreviated. However, you can clear mappings by putting the letter c after the above listing command, as in :imapc
to clear insert mode mappings. Abbreviations can be cleared with :abclear
, or just for insert mode :iabclear
and just for command mode :cabclear
.