Getting Solarized Working in Vim and iTerm2

May 16, 2012

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.


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

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.

Author's profile picture

Mark H. Nichols

I am a husband, cellist, code prole, nerd, technologist, and all around good guy living and working in fly-over country. You should follow me on Twitter.