Neovim: completion menu auto-inserts first match
Symptom
Typing vim. in a Lua buffer opens the completion menu but immediately inserts
the first match (âFâ from vim.fn). Deleting it closes the menu with no way to
reopen it mid-insertion.
Cause
Default completeopt is menu,preview, which pre-selects the first item.
Fix
Add to init.lua:
o.completeopt = "menu,menuone,noselect"
menuoneopens the menu even with a single matchnoselectprevents auto-selection, so nothing is inserted until confirmed
with<C-n>or<C-y>