vim Autocomplete
Pressing Ctrl-n (forward) and Ctrl-p (backwards) gives you word-autocomplete based on words in the current file. When you have multiple matches, choose from the list with arrow cursors and press Ctrl-y or Enter (or use Ctrl-p and Ctrl-n).
Pressing Ctrl-x followed by Ctrl-l gives you line-autocomplete. Use Ctrl-p, Ctrl-n, Ctrl-l, or up/down cursors to move through the list.
vim also provides filename-autocomplete with Ctrl-x followed by Ctrl-f.
Ctrl-e is to cancel the autocomplete.
Autocompletion can be based on open buffers, dictionary, include files etc. See more at:
- Let Vim do the typing, by George Brock
- Autocompletion Support in Vim, by Eugen Paraschiv on Baeldung
PS: Autocompletion can be set with something like this: :set complete+=k,.