Solarized color setup on Vim and iTerm2 - NonText chars highlight color displayed incorrectly

StackOverflow https://stackoverflow.com/questions/15548896

Pregunta

I use iTerm2 (Build 1.0.0.20130319) and Vim (bin of MacVim Snapshot 66) on top of OS X 10.7.5 as my CLI editing team.

iTerm2:

  • Color scheme: Solarized Dark
  • Terminal type: xterm
  • Minimum contrast: lowest
  • Transparency: none
  • Dimming: disabled
  • Background image: none

Vim:

set t_Co=16
set background=dark
colorscheme solarized

echo &t_Co returns 16. Generally I do not seem to have issues with a basic setup. But additionally I try to give "NonText" and "SpecialKey" characters a color value avaiable from the solarized color palette (palette can be found here).

highlight NonText ctermfg=0
highlight NonText guifg=#073642

highlight SpecialKey ctermfg=0
highlight SpecialKey guifg=#073642

The strange thing is while the "SpecialKey" group displays the "cterm" color value correctly, the "nonText" group does not. It seems that it displays the value 8 which is used by "ctermbg". As a consequence all "NonText" characters are not visible anymore. Both groups accept the "guifg" values btw.

Am I missing something which could interfere with my setup?

¿Fue útil?

Solución

I found a solution on the solarized bugtracker.

This config lets one assign colors to certain elements and groups:

highlight CursorLineNr cterm=none ctermfg=0 guifg=#073642
highlight NonText cterm=none ctermfg=0 guifg=#073642
highlight SpecialKey cterm=none ctermfg=0 guifg=#073642 ctermbg=8 guibg=#002b36

Notice the

cterm=none

which fixes the problem.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top