leonormes
leonormes

Reputation: 1029

How to stop vim colorscheme using wrong colours for visible tab characters

In my vim setup, I have invisible char show up with set list. I am using solarized dark theme, but changing theme I still get the same problem and sometimes a lot worse! The tab characters are showing up a different colour from the background.

Coloured tabs

How do I stop this behaviour as the effect is overpowering when it should be subtle!

Upvotes: 1

Views: 588

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172540

:help 'listchars' explains:

The "NonText" highlighting will be used for "eol", "extends" and
"precedes".  "SpecialKey" for "nbsp", "space", "tab" and "trail".
|hl-NonText| |hl-SpecialKey|

So, what's annoying you is the background color of the SpecialKey highlight group. (Unless you use some special indent-highlight plugin, but you would have told us, right?)

To fix this, just redefine the highlight group, after a :colorscheme command in your ~/.vimrc. For example, clear the background color:

:highlight SpecialKey ctermbg=NONE guibg=NONE

Upvotes: 6

Related Questions