Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/map.txt`
8541e7efb13f12f97d78670a954f3c7dc801db537c15be4c0000000100000fa2
  *:nunmap*
:vu[nmap] {lhs}			|mapmode-v|		*:vu*   *:vunmap*
:xu[nmap] {lhs}			|mapmode-x|		*:xu*   *:xunmap*
:sunm[ap] {lhs}			|mapmode-s|		*:sunm* *:sunmap*
:ou[nmap] {lhs}			|mapmode-o|		*:ou*   *:ounmap*
:unm[ap]! {lhs}			|mapmode-ic|		*:unm!* *:unmap!*
:iu[nmap] {lhs}			|mapmode-i|		*:iu*   *:iunmap*
:lu[nmap] {lhs}			|mapmode-l|		*:lu*   *:lunmap*
:cu[nmap] {lhs}			|mapmode-c|		*:cu*   *:cun* *:cunmap*
:tunma[p] {lhs}			|mapmode-t|		*:tunma* *:tunmap*
			Remove the mapping of {lhs} for the modes where the
			map command applies.  The mapping may remain defined
			for other modes where it applies.
			It also works when {lhs} matches the {rhs} of a
			mapping. This is for when an abbreviation applied.
			Note: Trailing spaces are included in the {lhs}.
			See |map-trailing-white|.

:mapc[lear]			|mapmode-nvo|		*:mapc*   *:mapclear*
:nmapc[lear]			|mapmode-n|		*:nmapc*  *:nmapclear*
:vmapc[lear]			|mapmode-v|		*:vmapc*  *:vmapclear*
:xmapc[lear]			|mapmode-x|		*:xmapc*  *:xmapclear*
:smapc[lear]			|mapmode-s|		*:smapc*  *:smapclear*
:omapc[lear]			|mapmode-o|		*:omapc*  *:omapclear*
:mapc[lear]!			|mapmode-ic|		*:mapc!*  *:mapclear!*
:imapc[lear]			|mapmode-i|		*:imapc*  *:imapclear*
:lmapc[lear]			|mapmode-l|		*:lmapc*  *:lmapclear*
:cmapc[lear]			|mapmode-c|		*:cmapc*  *:cmapclear*
:tmapc[lear]			|mapmode-t|		*:tmapc*  *:tmapclear*
			Remove ALL mappings for the modes where the map
			command applies.
			Use the <buffer> argument to remove buffer-local
			mappings |:map-<buffer>|
			Warning: This also removes the |default-mappings|.

:map				|mapmode-nvo|
:nm[ap]				|mapmode-n|
:vm[ap]				|mapmode-v|
:xm[ap]				|mapmode-x|
:sm[ap]				|mapmode-s|
:om[ap]				|mapmode-o|
:map!				|mapmode-ic|
:im[ap]				|mapmode-i|
:lm[ap]				|mapmode-l|
:cm[ap]				|mapmode-c|
:tma[p]				|mapmode-t|
			List all key mappings for the modes where the map
			command applies.  Note that ":map" and ":map!" are
			used most often, because they include the other modes.

:map    {lhs}			|mapmode-nvo|		*:map_l*
:nm[ap] {lhs}			|mapmode-n|		*:nmap_l*
:vm[ap] {lhs}			|mapmode-v|		*:vmap_l*
:xm[ap] {lhs}			|mapmode-x|		*:xmap_l*
:sm[ap] {lhs}			|mapmode-s|		*:smap_l*
:om[ap] {lhs}			|mapmode-o|		*:omap_l*
:map!   {lhs}			|mapmode-ic|		*:map_l!*
:im[ap] {lhs}			|mapmode-i|		*:imap_l*
:lm[ap] {lhs}			|mapmode-l|		*:lmap_l*
:cm[ap] {lhs}			|mapmode-c|		*:cmap_l*
:tma[p] {lhs}			|mapmode-t|		*:tmap_l*
			List the key mappings for the key sequences starting
			with {lhs} in the modes where the map command applies.

These commands are used to map a key or key sequence to a string of
characters.  You can use this to put command sequences under function keys,
translate one key into another, etc.  See |:mkexrc| for how to save and
restore the current mappings.

							*map-ambiguous*
When two mappings start with the same sequence of characters, they are
ambiguous.  Example: >
	:imap aa foo
	:imap aaa bar
When Vim has read "aa", it will need to get another character to be able to
decide if "aa" or "aaa" should be mapped.  This means that after typing "aa"
that mapping won't get expanded yet, Vim is waiting for another character.
If you type a space, then "foo" will get inserted, plus the space.  If you
type "a", then "bar" will get inserted.

Trailing white space ~
							*map-trailing-white*
This unmap command does NOT work: >
	:map @@ foo
	:unmap @@ | print

Because it tries to unmap "@@ ", including the white space before the command
separator "|".  Other examples with trailing white space: >
	unmap @@ 
	unmap @@     " comment

An error will be issued, which is very hard to identify, because the ending
whitespace character in `unmap @@ ` is not visible.

A generic solution is to put the command separator "|" right after the mapped
keys.  After that white space and a comment may follow: >
	unmap @@|    " comment


1.2 SPECIAL ARGUMENTS					*:map-arguments*

"<buffer>", "<nowait>", "<silent>", "<script>", "<expr>" and
"<unique>" can be used in any order.  They must

Title: Vim Mapping Commands: Unmapping, Clearing, and Listing
Summary
This section details Vim commands for unmapping keys (`:unmap`), clearing all mappings (`:mapclear`) for specific modes, and listing existing mappings (`:map`). It explains how these commands work in different modes (Normal, Visual, Insert, etc.) and how ambiguous mappings are handled. It also provides notes on trailing whitespace in mapping commands and introduces special arguments for advanced mapping configurations.