map keyboard_key command_to_execute |
Insert mode maps begin with the command map! and look something like this:
map! keyboard_key command_to_execute |
![]() | Avoid re-mapping the <F1> key as this is always mapped to vim's help. |
map <F2> iTo whom it may concern, <CR><CR><TAB> |
![]() | If you forgot what maps you have or just want to see what maps you have defined you can simply type: :map or :map! and hit enter. The defined maps will show up in the "status bar." |
![]() | To make maps permanent add them to your .vimrc file. |
map! ,h1 <H1></H1><ESC>2ba map! ,h2 <H2></H2><ESC>2ba map! ,h3 <H3></H3><ESC>2ba |
For more complex map examples see the section Example maps and vimrc files.
For more information about mapping keys type:
:help key-mapping |