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

How do I enable a popup menu for command-line tab completion in Neovim?

Answer

:set wildoptions=pum

Explanation

Setting wildoptions=pum tells Neovim to use its popup menu for command-line tab completion instead of the traditional horizontal wildmenu bar. The popup menu appears above the command line, is vertically scrollable, and stays out of the way of the file content — making it far more usable when you have many completions to browse.

How it works

  • pum stands for popup menu — the same floating window used for insert-mode completion.
  • When you type :e and press <Tab>, Neovim opens a scrollable popup of file and directory matches instead of cycling through them one at a time or showing a cramped horizontal list.
  • Navigate the popup with <Tab> / <S-Tab>, <C-n> / <C-p>, or arrow keys. Press <Enter> to confirm or <Esc> to dismiss.
  • You can combine values: :set wildoptions=pum,tagfile also shows the tag file path next to tag completions.

Example

With the default wildmenu, completing :b (switch buffer) shows:

buffers.txt  config.lua  init.lua

With wildoptions=pum, a floating popup appears with all open buffers listed vertically, filterable as you type more characters.

Tips

  • Combine with wildmenu and wildignorecase for a full enhanced completion experience:
set wildmenu
set wildoptions=pum
set wildignorecase
  • Set pumblend to make the popup semi-transparent: :set pumblend=15
  • This option is Neovim-specific; stock Vim does not support wildoptions=pum.

Next

How do I change the working directory to the folder containing the current file without affecting other windows?