Neovim for Beginners — Built-in Completion
Completion is a broad topic to cover. We will start with the basics, and continue with completion plugins, LSP (Language Server Protocol) completion, and AI (Artificial Intelligence) completion in later articles.
In this article, we are going to
- Learn command-line completion
- Learn insert-mode completion
This article is part of the Neovim for Beginners series.
The Neovim configuration files can be found in this repository.
When we type
: to enter command-line mode, there are common commands that can help us to complete the word before the cursor (
List names that match the pattern in front of the cursor.
A match is done on the pattern in front of the cursor. The match (if there are several, the first match) is inserted in the place of the pattern.
We can change this command using the
wildchar (default to
Tab) option. E.g. if we type
:set wildchar=<S-c>, now instead of pressing
Tab, we need to type
Shift + c to get the completion.
By default, pressing
Tab selects the first match. Press
S-Tab if we want to select the last match.
We can press
C-P (previous) to navigate to the next or previous match.
incsearch is set, entering a search pattern for
? and the current match is…