tmux vim colorscheme background is not showing

in your .tmux.conf:

set -g default-terminal "screen-256color"

This happens when TERM isn’t set to the correct screen[-256color] in Vim’s environment, usually by some shell startup script. If that is the case – for example, you have a

TERM=xterm-256color

, either remove it or make sure it checks the original value of TERM before changing it, e.g.

if [[ "$TERM" = xterm ]]; then
    TERM=xterm-256color
fi

Late comment, but I had looked through all the threads and couldn't resolve it until I did the following. All I had to do was add a second check of

if [[ $TERM == screen]]; then
    TERM=screen-256color
fi

in addition to the first conditional statement in my .bashrc file:

if [[ $TERM == xterm ]]; then
    TERM=xterm-256color
fi

I also had this in .tmux.conf:

set -g default-terminal "screen-256color"

In my .vimrc file:

set term=screen-256color

Tags:

Vim

Tmux