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