Zanshin.net

because not enough websites start with the letter 'Z'

Getting Solarized Working in Vim and iTerm2

For some time now I’ve been using the Solarized color scheme for my editors and console windows. The one place I wasn’t having any success with Solarized was running Vim in iTerm2. After much searching and some trial and error experimenting I finally found the root problem.

Root Problem

You must have syntax on in your .vimrc in order for colors to work.

.vimrc

Here’s the relevant portion of my .vimrc file:

1
2
3
4
syntax on
set background=dark
let g:solarized_termtrans = 1
colorscheme solarized

Without syntax on the colors from the Solarized theme do not appear for me in either Terminal or iTerm2. The let g:solarized_termtrans = 1 setting controls transparency. Without this setting the scheme looks horrid in Terminal. The g:solarized_termtrans setting seems to have little or no effect in iTerm2.

In both Terminal and iTerm2 I have the terminal type set to xterm-256color.