0

I have an issue with using Vim within iTerm. Works as expected first time but any restart or new instance of iTerm and everything is broken. Take this as an example

Download and open iTerm and get default theme

fresh launch

Next import the solarized dark colour scheme

enter image description here

Then fire up vim and open a file

enter image description here

Everything is as expected. Now quit all instances of iTerm and reopen

enter image description here

Command line is as expected. Now open vim and open the same file.

enter image description here

Broken. Has any one seen something like this before?

UPDATE

Now if I install the solarized color scheme in Vim the results look different again.

enter image description here

This scheme is acceptable (even go as far to say correct) but my question is where do the original colors come from then and how can i set those as default?

James Hughes
  • 6,194
  • 4
  • 31
  • 44

2 Answers2

1

As far as i understand, iTerm is terminal emulator, so you probably use terminal version of vim, however your .vimrc contains no colorscheme settings for this version, only for gui. Try moving

set colorscheme solarized

outside

if has('gui running')

And R
  • 487
  • 1
  • 14
  • 17
  • This is very true. HOWEVER my real question is where does the second image (the first vim launch) get its colors from and why do they change? – James Hughes Mar 15 '12 at 15:17
  • 1
    No idea, but you can try :verbose hi Boolean to learn where does highlighting for Boolean come from (Boolean was what autocompletion proposed to me first, try other syntax groups too). – And R Mar 15 '12 at 17:37
1

The difference is the COLORFGBG environment var. It's set based on whether the background is light or dark. COLORFGBG=0;15 gives you the before screen and COLORFGBG=12;8 gives you the after screen.

George
  • 4,189
  • 2
  • 24
  • 23