How do I make floating windows semi-transparent in Neovim?
Answer
:set winblend=20
Explanation
Neovim's winblend option controls the pseudo-transparency of floating windows. When set to a non-zero value, floating windows (completion menus, hover documentation, diagnostics, etc.) blend with the content behind them, making the UI feel less intrusive and visually layered. This requires a terminal with true color support and a colorscheme that sets background colors.
How it works
winblendis a window-local option ranging from0(fully opaque) to100(fully transparent)- Setting it globally applies to all new floating windows:
:set winblend=20 - Setting it per-window with
:setlocal winblend=20while the floating window is focused - Plugins that open floating windows (LSP hover, telescope, etc.) often expose a
winblendoption in their config
Example
" Apply to all floating windows globally
:set winblend=20
" Or set in a Lua autocmd to apply only to floating windows:
autocmd BufEnter * if &buftype == 'nofile' | setlocal winblend=15 | endif
A value of 10–30 is typically comfortable — enough to see content underneath without making text hard to read.
Tips
- Pair with
pumblendto also make the popup menu (insert-mode completion) transparent::set pumblend=20 - Requires
termguicolorsto be enabled::set termguicolors - If the background looks wrong, ensure your terminal supports true color and your colorscheme sets background highlight groups
- For Neovim Lua configs, set globally:
vim.opt.winblend = 20andvim.opt.pumblend = 20