True Color and Highlight Groups

True Color and Highlight Groups

Turn on true color first

Terminals historically offered 256 colors. Modern terminals support 24-bit color, but Neovim only uses it when you ask:

set termguicolors

With this set, highlight definitions use guifg/guibg hex values like #00ff00 instead of approximated terminal palette indexes. Every theme in this guide assumes it is on.

Everything is a highlight group

Every piece of text Neovim draws — keywords, strings, comments, the status line, even the line numbers — belongs to a highlight group. A colorscheme is nothing more than a list of rules assigning colors to those groups.

Inspect what is under your cursor:

:Inspect

Restyle a group live with :hi:

:hi Comment guifg=#D1D1D1 gui=italic
:hi String  guifg=#FFF066

The change applies instantly — which makes building a theme a tight feedback loop: look at code, tweak a group, look again.

The groups that matter most

You can get a complete-feeling theme from a dozen groups:

GroupWhat it paints
Normalplain text and default background
Commentcomments
Stringstring literals
Functionfunction names
Keywordif, for, def, local, …
Operator=, +, ->, …
Numbernumeric literals
Booleantrue / false

Start with these, then extend to UI groups (CursorLine, StatusLine, Visual) as taste demands.