Skip to content

Latest commit

 

History

History
69 lines (37 loc) · 1.53 KB

abbreviations.md

File metadata and controls

69 lines (37 loc) · 1.53 KB

excommand abbreviate

Vim Reference

: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.

Short Description

List, create or remove abbreviations.

Examples

Creating an abbreviation

Fixing typos

:abbreviate teh the

create abbreviation

Expanding snippets

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.

expanding snippet

Using <expr>

:iabbrev <expr> date, strftime("%Y-%m-%d")

abbreviate expression

List abbreviations

:abbreviate

list abbreviations

The exclamation mark ! means that the abbreviation is for insert and commandline mode. An i means for insert mode only, and a c means commandline mode only.

Remove abbreviations

To remove a specific abbreviation.

:unabbreviate abname

To remove all abbreviations.

:abclear

remove abbreviations

External Links