solarized and the bliss of great color everywhere

I’m a fan of syntax highlighting. To me it makes programming easier since variables and strings stand out visually. In a GUI environment a nice color theme has the same effect. In both cases it can make things more pleasant when you have to spend a lot of time looking at a screen.

Over the years I’ve enjoyed all sorts of variations and have, at times, changed the look of my desktop. Most of the time this was done when my theme for syntax highlighting or desktop look annoyed me in some fashion. Recently I’ve been just trying to find something that works well, since tweaking the desktop is really not a productivity enhancer.

Earlier this year I came across solarized and started using it, with an almost religious zeal. Solarized is a very well designed and thought out set of colors, which comes in a light and dark variety and is available for the things I use the most: VIM and Bash along with things that live in Bash such as less and ls in the form of dircolors, and tmux.

Now everything seems to just look great and consistent. Here is how I got it up and running.

# grab the solarized colors for tmux
curl -s > ~/.tmuxcolors-dark.conf
curl -s > ~/.tmuxcolors-dark.conf
# get the VIM stuff ... you'll need to be running Vundle. see references
vim +"BundleInstall 'altercation/vim-colors-solarized.git'"
# get the dircolors items
curl -s '' > ~/.dircolors.ansi-dark

Then grab the Bash colors from (There are a lot of interesting things in that script, worth checking out) and add them to our ~/.bashrc.

Since I like to switch between the light and dark themes depending on where I work and how bright it is, I create a small script called term-theme, which let’s me switch the colors for the terminal and the editor easily.


tmux_stub=$(sed '/AUTO SOLARIZED/q' < ~/.tmux.conf)

update_theme () {

  # update the gnome term theme if we are running X
  if [ "$DISPLAY" ]; then

  # directory colors
  cp -f ~/.dircolors.ansi-${SCHEME} ~/.dircolors
  eval `dircolors ~/.dircolors`

  # update vimrc
  if [ -e ~/.vimrc ]; then
    sed -i "s/\\(set background\\)=.*/\\1=${SCHEME}/" ~/.vimrc

  # update any running VIM session that are running as server
  if [ "$(which vim)" ]; then
    for x in $(vim --serverlist); do
      vim --servername ${x} --remote-send "<ESC>:set background=${SCHEME}<CR>"

  # update TMUX
  (echo "${tmux_stub}"; cat ~/.tmuxcolors-${SCHEME}.conf) > ~/.tmux.conf
  [[ "${TMUX}" ]] && tmux source-file ~/.tmux.conf &> /dev/null

case $1 in
    update_theme $1

echo “try calling me with ‘light’ or ‘dark'”
exit 0

Now I can run term-theme light to switch to the light theme, which even updates my running GVIM instance!

The script works well, without much changing. You just need a line like

set background=dark

in your .vimrc, and you .tmux.conf file needs to contain a line that looks like this:


and the script will remove everything after that line and add the new color scheme and apply it.

Now to really bring it home you can also set less up to do syntax highlighting.

sudo apt-get install python-pygments
export LESSCOLORIZER=pygmentize

It all looks pretty nice on Ubuntu using the Radiance theme.

VIM solarized

Leave a Reply

Your email address will not be published. Required fields are marked *