4
votes

I am using tmux 2.1, terminator 0.97 and vim 7.4 on ubuntu Trusty 14.04

Vim colorscheme is solarized-dark. The colors are fine outside of tmux, but when using tmux they are slightly different.

The difference is that the background is slightly brighter, using base02 instead of base03 as a background (cf http://ethanschoonover.com/solarized).

I have been looking a lot of issue reports on colors with tmux and I tried pretty much every combination of settings for vim and tmux.

I have t_Co=256 in vim. Also tried t_Co=16

set -g default-terminal "xterm" or "screen" or "screen-256color" doesn't change anything.

When I try "xterm-256color" the background is base03 but the base02 is highlighting almost all the text. The colors are still messed up.

This happens with gnome-terminal too. Both terminator and gnome-terminal have the solarized theme and color palette.

My macbook pro has the exact same .vimrc and .tmux.conf settings and everything is fine there.

Any idea how I could fix this?

EDIT: I do not have the color issues when sshing + tmux from my laptop, so it is likely an issue with the terminal emulators on ubuntu.

2

2 Answers

8
votes

I solved the issue by setting TERM=screen-256color in .zshrc

Depending on your terminal and shell you might want to alternatively use TERM=xterm-256color and .bashrc instead.

For some reason set -g default-terminal "screen-256color" in .tmux.conf was not enough.

1
votes

Have you tried:

let g:solarized_termtrans = 0 or 1
let g:solarized_degrade = 0 or 1
let g:solarized_contrast = "normal" or "high" or "low"

?

Also, a note of Solarized creators say that if you going to use the colorscheme in terminal, is important to add the scheme colors into terminal's color pallete. In gnome-terminal you can do it in Edit > Profile Preferences > tab Colors and adding mannualy the colors to the colors pallete. You can check the note in https://github.com/vim-scripts/Solarized, in the section IMPORTANT NOTE FOR TERMINAL USERS.