How do I configure Vim's built-in auto-completion?
Answer
:set completeopt=menu,menuone,noselect
Explanation
The completeopt option controls the behavior of the completion popup menu. Proper configuration makes <C-n> and <C-p> completion more user-friendly.
How it works
menushows a popup menu with matchesmenuoneshows the menu even with a single matchnoselectdoes not auto-select the first itemnoinsertdoes not auto-insert text
Example
set completeopt=menu,menuone,noselect
Now <C-n> in insert mode shows a popup without auto-inserting.
Tips
<C-n>triggers keyword completion<C-x><C-f>completes file paths<C-x><C-l>completes whole lines<C-x><C-o>triggers omni completion<C-y>accepts the selected completion<C-e>cancels the completion menu