Abbreviations of Vim Commands and Options

There are so many commands and options in Vim that we recommend learning them by name first. Almost all commands and options (at least any that have more than a few characters) have some associated short form. These can save time, but be sure you know what you’re abbreviating! This author has had some embarrassing and unexpected results using short forms thought to be one thing that turned out to be something quite different.

As you become more experienced and develop your favorite subset of Vim commands and options, using some of the abbreviated forms for commands and options saves time. Vim typically tries for Unix-like abbreviations for options and allows for the shortest unique initial substring for commands’ abbreviations.

Some abbreviations for common commands include:

nnext
prevprevious
qquit
seset
wwrite

Some abbreviations for common options include:

aiautoindent
bgbackground
fffileformat
ftfiletype
icignorecase
lilist
nunumber
scshowcommand (notshowcase)
smshowmatch
swshiftwidth
wmwrapmargin

Short forms for commands and options save time when you know your commands and options well. But for scripting and setting up sessions with commands in your .vimrc or .gvimrc files, you’re more likely to save time in the long run by sticking with full command and option names. Your configuration file and scripts are easier to read and debug when you use full names.

Note

Note that this is not the approach taken with the suite of Vim script files (syntax, autoindent ...

Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.