0
votes

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?

1
Interesting, when I set set t_Co=8then "NonText" chars accept the given value. But then other problems arise. So not really a solution.Saucier
1. The number of colors that corresponds to xterm is 8, not 16. 2. Vim knows how to get the correct number of colors for the $TERM it picked up when it started. If iTerm is set to xterm, Vim correctly infers "8 colors" and you have absolutely no need to do anything in Vim. 3. Actually, setting term-related options to non-standard values or forcing them to values not supported by your terminal is quite a bad idea.romainl
What "other problems"?romainl
@romainl, understood your points. An alternative is to tell iTerm2 to emulate xterm-256, which results in the same problem as above. When using 8 colors only, the colors of the powerline plugin are not displayed correctly.Saucier
Frankly, the problem is solarized. Do you see all the solarized questions on the right? That thing is a mess. And Powerline is not better. There's no point using anything other than xterm-256color in this day and age. What is the problem with xterm-256color? That your NonText doesn't work?romainl

1 Answers

2
votes

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.