How do I make Vim's completion popup menu partially transparent so I can see text behind it?
Answer
:set pumblend=10
Explanation
Neovim's 'pumblend' option controls the pseudo-transparency of the insert-mode completion popup menu (and other floating windows). Setting it to a value between 1 and 100 lets underlying text show through, so you can read context behind the menu without dismissing it.
How it works
'pumblend'accepts an integer from0(fully opaque, default) to100(fully transparent)- A value around
10–20gives a subtle tint that is easy to read - The effect is rendered using terminal blending — it requires a terminal with true-color support
- Also controls the transparency of other floating windows (LSP hover, diagnostics) when set via
'winblend'per-window
Example
" In init.vim or vimrc
set pumblend=15
Or in Lua (init.lua):
vim.opt.pumblend = 15
Tips
'pumblend'affects the global default; setwinblendon individual floating windows for finer control- For full effect, make sure your terminal reports
$COLORTERM=truecolorand your Neovim colorscheme supportsguibgcolors - Set
pumblend=0to restore opaque menus if the transparency is distracting - Note: this option is Neovim-only and has no effect in Vim