Make It Snappy With Vim
June 22, 2009
Vim is still one of the most powerful text editors out there. One of its more useful features is that it allows you to set up your own abbreviations and mappings. These can speed up the typing of stock phrases or do far more complicated things. Enter these in command mode to try them out, or add them to your ~/.vimrc (without the initial colon) if you want them to stay.
Abbreviations (use iab for abbreviations that work only in insert mode or ab for abbreviations that work in any mode) and mappings (use imap for mappings that work in insert mode, or map for mappings that work in multiple modes) are very similar. Broadly speaking, if you're doing something you'd normally use the command-line mode for, use a mapping. If you want a set of characters to expand into a longer string while you're typing, use an abbreviation.
To list all the mappings that have been set, use :map.