vimtricks.wiki Concise Vim tricks, one at a time.

How do I make Vim completion menu appear without auto-inserting a candidate?

Answer

:set completeopt=menuone,noinsert,noselect

Explanation

When completion inserts text too early, you lose control over what gets committed and where undo breakpoints land. Setting completeopt to menuone,noinsert,noselect gives you a safer workflow: the popup menu appears immediately, but no candidate is inserted until you confirm one. This is especially useful in long identifiers, API-heavy code, or when mixing manual typing with completion.

How it works

:set completeopt=menuone,noinsert,noselect
  • menuone: always show the completion menu, even with one match
  • noinsert: do not insert any completion text automatically
  • noselect: do not preselect an item in the menu

Together, these options make completion an explicit action instead of an implicit one. You keep your original typed text untouched until you confirm with <CR>, <C-y>, or another accept key.

Example

Suppose you type:

fmt.pr

With this setting, Vim shows candidates like fmt.Println and fmt.Printf, but your buffer stays as:

fmt.pr

until you actively choose one.

Tips

  • Use :setlocal completeopt=menuone,noinsert,noselect in filetype plugins when you want per-language behavior.
  • Pair this with popup-menu navigation mappings for a predictable completion flow.

Next

How do I jump to the next lowercase mark in Vim's mark order?