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

How do I enable true color (24-bit) support in Vim?

Answer

:set termguicolors

Explanation

The termguicolors option enables 24-bit RGB color support, allowing color schemes to use millions of colors instead of the terminal's 256-color palette.

How it works

  • :set termguicolors enables true color mode
  • Color schemes use guifg/guibg values even in terminal Vim
  • Requires a terminal that supports true color

Example

set termguicolors
colorscheme onedark

Tips

  • Most modern terminals support true color (iTerm2, Alacritty, kitty, Windows Terminal)
  • Test with :echo $TERM — should be xterm-256color or similar
  • Some terminals need t_8f and t_8b settings in Vim
  • Neovim has better true color support out of the box
  • Many popular color schemes look much better with true colors

Next

How do you yank a single word into a named register?