How do I customize syntax highlighting colors?
Answer
:highlight Group ctermfg=color
Explanation
The :highlight command changes the appearance of a highlight group. You can modify colors for any syntax element, UI element, or custom group.
How it works
:highlight Comment ctermfg=graymakes comments grayctermfgsets the foreground color in terminalctermbgsets the background colorcterm=bold,underlinesets text attributes
Example
highlight Comment ctermfg=green
highlight LineNr ctermfg=darkgray
highlight Search ctermbg=yellow ctermfg=black
highlight StatusLine ctermbg=blue ctermfg=white
Tips
:highlightwith no arguments shows all groups- Use
guifg/guibgfor GUI Vim or terminals with true color :highlight link GroupA GroupBmakes GroupA use GroupB's colors:highlight clearresets all highlighting- Colors: black, red, green, yellow, blue, magenta, cyan, white, and numbers 0-255