Configuring solarized colorscheme in gnome terminal, tmux and vim

Carlo picture Carlo · Apr 16, 2014 · Viewed 33.7k times · Source

I'm struggling to make the Solarized colorscheme correctly working on an Ubuntu 13.10 machine inside Vim inside tmux inside the gnome-terminal.

I've started configuring gnome-terminal using the script on this repository and it displays the colors correctly. The same goes if I run Vim (with the official Solarized colorscheme) inside the terminal, without tmux.

Then I tried to configure tmux using this. It happens that when I run Vim the syntax highlight for php or javascript code is wrong or, at least, different from the one I see running Vim without tmux. I've tried also running tmux as tmux -2. The colors are different, but still the syntax highlight is not correct.

Answer

rasmusx picture rasmusx · Apr 17, 2014

I tested it out and got it working in the following way:

  1. Install gnome solarized colorscheme. You can get it from https://github.com/sigurdga/gnome-terminal-colors-solarized.

  2. Install solarized colorscheme for vim. You can get it from https://github.com/altercation/vim-colors-solarized. In .vimrc you should add following settings:

    set t_Co=256
    set background=dark
    colorscheme solarized
    
  3. Set correct TERM variable by adding following line to your .bashrc/.zshrc

    export TERM=screen-256color-bce
    
  4. Run gnome-terminal, tmux, vim and profit.