| Tip 111 | Meet Vim’s Keyword Autocompletion |
With keyword autocompletion, Vim attempts to guess the word that we’re typing, which can save us from completing it by hand.
Vim’s autocomplete functionality is triggered from Insert mode. When invoked, Vim builds a word list from the contents of each buffer in the current editing session and then examines the characters to the left of the cursor, looking for a partial word. If one is found, the word list is filtered to exclude anything that doesn’t begin with that partial word. The resulting word list is presented in a menu from which we can select our match.
This figure shows two screenshots, one taken before and one after triggering Vim’s keyword autocompletion:
In this case, the letter “s” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access