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 termguicolorsenables true color mode- Color schemes use
guifg/guibgvalues 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 bexterm-256coloror similar - Some terminals need
t_8fandt_8bsettings in Vim - Neovim has better true color support out of the box
- Many popular color schemes look much better with true colors