Vim:KeyMapping
lastmod 2023-04-22created 2016-01-097 edits
Notes on modes (Mode) and mappings (Mapping).
Mode
- Bamanggae's vim tutorial 28 - :map, :i.. : Naver Blog
- None: normal, visual, operator-pending
-
v: visual -
n: normal -
o: operator-pending -
i: insert -
c: command line -
!at the end of the command: insert, command line (e.g.:map!,:unmap!,:noremap!)
When mapping, putting the mode as a prefix applies a mapping that works only in that mode.
For example, use :nmap, :vmap, and so on.
Vim-map-mode-letter.png
Vim-map-mode-table.png
map
The :map command defines key mappings for normal mode.
noremap
NO-REcursive MAPping Mode. To prevent mappings from nesting, use the :noremap command.
unmap
To remove a mapping, use the :unmap command.
Example
nmap is short for "normal-mode key mapping". The <silent> option after nmap suppresses the display of commands executed during the mapping so that the new ;s command can do its job properly.