Code autocomplete
One of the most appealing features that modern IDEs have is code autocomplete. IDEs allow you to eliminate typos, look up hard-to-remember variable names, and save time by removing the need to type long variable names over and over again.
Vim has some built-in autocomplete functionality, and there are plugins that expand upon this.
Built-in autocomplete
Vim supports native autocomplete based on words available in open buffers. It’s available out of the box starting with Vim 7.0. Start by typing the beginning of a function name and hit Ctrl + n to bring up the autocomplete list. You can navigate the list using Ctrl + n and Ctrl + p. For example, open welcome.py
, enter insert mode, and start typing the first two letters of a function name: pr
(prepare_ingredient
). Press Ctrl + n. This will bring up a list of available options:
Figure 4.1 – Vim’s native autocomplete
Continue typing to dismiss the list.
In...