:help :abbreviate
:help :noreabbrev
:help :unabbreviate
:help :abclear
The commands shown above are for insert mode and commandline mode. There are variants only for insert or commandline mode.
Most of the time you probably need the insert mode abbreviations.
List, create or remove abbreviations.
:abbreviate teh the
iabbrev if, if(fillme)<cr>{<cr>}<esc>2k0f(vi(h
using the comma after
if
allows you to still write yourself an if-statement, and you can use other characters like dot, colon, and so on to create variations of your if-statement.
:iabbrev <expr> date, strftime("%Y-%m-%d")
:abbreviate
The exclamation mark
!
means that the abbreviation is for insert and commandline mode. Ani
means for insert mode only, and ac
means commandline mode only.
To remove a specific abbreviation.
:unabbreviate abname
To remove all abbreviations.
:abclear