Vim offers a comprehensive suite of insertion-completion capabilities. From programming language-specific keywords to filenames, dictionary words, and even entire lines, Vim knows how to offer possible completions to partially entered text. Not only that, but Vim abstracts the semantic of dictionary-based completion to include completions based on synonyms for the completed word from a thesaurus!
In this section we look at the different completion methods, their syntaxes, and descriptions of how they work with examples. The methods of completion include:
Current file keywords
Current and included file keywords
Tags (as in ctags)
Vim command line
all completion commands start with CTRL-X. The second key specifically defines the type of completion
Vim attempts. For example, the command to autocomplete filenames is
CTRL-X CTRL-F. (Not all the commands are so
mnemonic, unfortunately.) Vim uses unmapped (default) keys, which
allows you to shorten most of these commands to just the second
keystroke by mapping the commands appropriately. (For instance, you
can map CTRL-X CTRL-N to just CTRL-N.)
All completion methods have virtually identical behavior: they cycle through a list of candidate completions as you retype the second keystroke. Thus, if you choose filename autocompletion through CTRL-X ...