Bill Agee's blog

Technology musings with a twist of user empathy.

How to Set Up the Solarized Color Scheme for Vim and iTerm2


When you stare at a display full of code for hours at a time, a nice looking color scheme is worth the time it takes to set up.

Enter Solarized, a great option for improving your overall text-editing life.

My officemate Kevin has been evangelizing Solarized for a while, so today I took the plunge and set it up, and man do I wish I had done this a while ago. Much of the content described below is straight from his setup - I definitely owe him.

The set of software I’m currently using with Solarized is:

  • iTerm2 (since in my experience it handles Solarized better than Terminal.app)
  • The command-line vim that ships with OSX (since MacVIM appears to have weird problems with :shell)
  • pathogen.vim (for easy installation of vim plugins)
  • The Solarized config files for iTerm2 and vim
  • NERDTree (a tree explorer for vim)

The results look fairly nice, IMO.

For future reference, here’s how I set everything up:

  1. Download the stable version of iTerm2:

    http://iterm2.googlecode.com

  2. Download and unzip the latest version of the Solarized .zip file (it contains the iTerm2 preset files you’ll need):

    http://ethanschoonover.com/solarized/files/solarized.zip

  3. In iTerm2, open “iTerm2 > Preferences > Profiles > Colors”, and click “Load Presets…” to load the Solarized color schemes (light and dark) that are found in the .zip in “solarized/iterm2-colors-solarized/”

    For more info see the iTerm2 README from solarized.zip - the path to it in the zip file is:

    solarized/iterm2-colors-solarized/README.md

  4. Use these instructions from the pathogen github README to install it - pathogen will be used further down to install solarized.vim and NERDTree:

    https://github.com/tpope/vim-pathogen#readme

  5. Install solarized.vim using pathogen:

    (For more info see http://ethanschoonover.com/solarized/vim-colors-solarized)

    $ cd ~/.vim/bundle
    $ git clone git://github.com/altercation/vim-colors-solarized.git
    In the parent directory of vim-colors-solarized:
    $ mv vim-colors-solarized ~/.vim/bundle/

  6. Install NERDTree:

    (See also http://programming34m0.blogspot.com/2011/04/nerd-tree-file-explorer-with-mac-vim.html)

    cd ~/.vim/bundle
    git clone git://github.com/scrooloose/nerdtree.git

  7. Set up your .vimrc appropriately - here’s mine:

    set ruler
    set cursorline
    "set number
    call pathogen#infect()
    syntax on

    filetype plugin indent on

    syntax enable

    " Solarized stuff
    let g:solarized_termtrans = 1
    set background=dark
    colorscheme solarized

  8. OPTIONAL: A nice choice for a terminal font is Inconsolata-dz - you can download it here, and configure iTerm2 to use it:

    http://nodnod.net/2009/feb/12/adding-straight-single-and-double-quotes-inconsola/