Home Explore Blog CI



neovim

16th chunk of `runtime/doc/map.txt`
bfbbf16686918b64fd1bf9fd0925f33106c69a506fe4b5fe0000000100000fa0
 mode, 'c' for Command-line
			mode, '!' for both.  These are the same as for
			mappings, see |map-listing|.

						*:abbreviate-verbose*
When 'verbose' is non-zero, listing an abbreviation will also display where it
was last defined.  Example: >

	:verbose abbreviate
	!  teh		 the
		Last set from /home/abcd/vim/abbr.vim

See |:verbose-cmd| for more information.

:ab[breviate] {lhs}	list the abbreviations that start with {lhs}
			You may need to insert a CTRL-V (type it twice) to
			avoid that a typed {lhs} is expanded, since
			command-line abbreviations apply here.

:ab[breviate] [<expr>] [<buffer>] {lhs} {rhs}
			add abbreviation for {lhs} to {rhs}.  If {lhs} already
			existed it is replaced with the new {rhs}.  {rhs} may
			contain spaces.
			See |:map-<expr>| for the optional <expr> argument.
			See |:map-<buffer>| for the optional <buffer> argument.

						*:una* *:unabbreviate*
:una[bbreviate] [<buffer>] {lhs}
			Remove abbreviation for {lhs} from the list.  If none
			is found, remove abbreviations in which {lhs} matches
			with the {rhs}.  This is done so that you can even
			remove abbreviations after expansion.  To avoid
			expansion insert a CTRL-V (type it twice).

						*:norea* *:noreabbrev*
:norea[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
			same as ":ab", but no remapping for this {rhs}

						*:ca* *:cab* *:cabbrev*
:ca[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
			same as ":ab", but for Command-line mode only.

						*:cuna* *:cunabbrev*
:cuna[bbrev] [<buffer>] {lhs}
			Same as ":una", but for Command-line mode only.

						*:cnorea* *:cnoreabbrev*
:cnorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
			same as ":ab", but for Command-line mode only and no
			remapping for this {rhs}

						*:ia* *:iabbrev*
:ia[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
			same as ":ab", but for Insert mode only.

						*:iuna* *:iunabbrev*
:iuna[bbrev] [<buffer>] {lhs}
			Same as ":una", but for insert mode only.

						*:inorea* *:inoreabbrev*
:inorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
			same as ":ab", but for Insert mode only and no
			remapping for this {rhs}

							*:abc* *:abclear*
:abc[lear] [<buffer>]	Remove all abbreviations.

							*:iabc* *:iabclear*
:iabc[lear] [<buffer>]	Remove all abbreviations for Insert mode.

							*:cabc* *:cabclear*
:cabc[lear] [<buffer>]	Remove all abbreviations for Command-line mode.

							*using_CTRL-V*
It is possible to use special characters in the rhs of an abbreviation.
CTRL-V has to be used to avoid the special meaning of most non printable
characters.  How many CTRL-Vs need to be typed depends on how you enter the
abbreviation.  This also applies to mappings.  Let's use an example here.

Suppose you want to abbreviate "esc" to enter an <Esc> character.  When you
type the ":ab" command in Vim, you have to enter this: (here ^V is a CTRL-V
and ^[ is <Esc>)

You type:   ab esc ^V^V^V^V^V^[

	All keyboard input is subjected to ^V quote interpretation, so
	the first, third, and fifth ^V  characters simply allow the second,
	and fourth ^Vs, and the ^[, to be entered into the command-line.

You see:    ab esc ^V^V^[

	The command-line contains two actual ^Vs before the ^[.  This is
	how it should appear in your vimrc file, if you choose to go that
	route.  The first ^V is there to quote the second ^V; the :ab
	command uses ^V as its own quote character, so you can include quoted
	whitespace or the | character in the abbreviation.  The :ab command
	doesn't do anything special with the ^[ character, so it doesn't need
	to be quoted.  (Although quoting isn't harmful; that's why typing 7
	[but not 8!] ^Vs works.)

Stored as:  esc     ^V^[

	After parsing, the abbreviation's short form ("esc") and long form
	(the two characters "^V^[") are stored in the abbreviation table.
	If you give the :ab command with no arguments, this is how the
	abbreviation will be displayed.

	Later, when the abbreviation is expanded because the user typed in
	the word "esc", the long form is subjected to the same type of

Title: Abbreviation Commands and Special Characters
Summary
This section details specific abbreviation commands, including `:norea[bbrev]`, `:ca[bbrev]`, `:cuna[bbrev]`, `:cnorea[bbrev]`, `:ia[bbrev]`, `:iuna[bbrev]`, and `:inorea[bbrev]`, which offer variations for no remapping, Command-line mode only, and Insert mode only. It also covers commands for clearing abbreviations: `:abc[lear]`, `:iabc[lear]`, and `:cabc[lear]`. The section further explains how to use special characters in abbreviations by using CTRL-V to escape them, providing an example of how CTRL-V is interpreted and stored when creating an abbreviation to insert an <Esc> character.