*map.txt* For Vim version 8.1. Last change: 2019 Jun 02
VIM REFERENCE MANUAL by Bram Moolenaar
Key mapping, abbreviations and user-defined commands.
This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
manual.
1. Key mapping |key-mapping|
1.1 MAP COMMANDS |:map-commands|
1.2 Special arguments |:map-arguments|
1.3 Mapping and modes |:map-modes|
1.4 Listing mappings |map-listing|
1.5 Mapping special keys |:map-special-keys|
1.6 Special characters |:map-special-chars|
1.7 What keys to map |map-which-keys|
1.8 Examples |map-examples|
1.9 Using mappings |map-typing|
1.10 Mapping alt-keys |:map-alt-keys|
1.11 Mapping an operator |:map-operator|
2. Abbreviations |abbreviations|
3. Local mappings and functions |script-local|
4. User-defined commands |user-commands|
==============================================================================
1. Key mapping *key-mapping* *mapping* *macro*
Key mapping is used to change the meaning of typed keys. The most common use
is to define a sequence of commands for a function key. Example: >
:map <F2> a<C-R>=strftime("%c")<CR><Esc>
This appends the current date and time after the cursor (in <> notation |<>|).
1.1 MAP COMMANDS *:map-commands*
There are commands to enter new mappings, remove mappings and list mappings.
See |map-overview| for the various forms of "map" and their relationships with
modes.
{lhs} means left-hand-side *{lhs}*
{rhs} means right-hand-side *{rhs}*
:map {lhs} {rhs} |mapmode-nvo| *:map*
:nm[ap] {lhs} {rhs} |mapmode-n| *:nm* *:nmap*
:vm[ap] {lhs} {rhs} |mapmode-v| *:vm* *:vmap*
:xm[ap] {lhs} {rhs} |mapmode-x| *:xm* *:xmap*
:smap {lhs} {rhs} |mapmode-s| *:smap*
:om[ap] {lhs} {rhs} |mapmode-o| *:om* *:omap*
:map! {lhs} {rhs} |mapmode-ic| *:map!*
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lma* *:lmap*
:cm[ap] {lhs}