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

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

  • winblend is a window-local option ranging from 0 (fully opaque) to 100 (fully transparent)
  • Setting it globally applies to all new floating windows: :set winblend=20
  • Setting it per-window with :setlocal winblend=20 while the floating window is focused
  • Plugins that open floating windows (LSP hover, telescope, etc.) often expose a winblend option 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 pumblend to also make the popup menu (insert-mode completion) transparent: :set pumblend=20
  • Requires termguicolors to 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 = 20 and vim.opt.pumblend = 20

Next

How do I set up a local leader key for file-type-specific mappings that don't conflict with global mappings?