Vim + tmux visual mode does not stand out

When I run vim in tmux , the syntax highlighting works fine, except for the visual mode, it works, but does not change the color of the selected text, which I find quite annoying.

The problem remains the same even when I switch the color scheme (I am currently using milk) I have the option set t_Co = 256 on my vimrc My .tmux.conf file is the same as the t-williams.conf example (the line "just added set -f default-terminal "xterm")

I already tried some solutions to problems related to 256 color support

any advice?

+6
source share
2 answers

Recommended setting for tmux:

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

and you don't need

 set t_Co=256 

in ~/.vimrc .

+8
source

Make sure your terminal declares itself as a 256-color terminal (e.g. xterm-256color ). This will install TERM in bash, which will be read by tmux, and automatically set the default-terminal parameter to screen-256color .

For example, in a terminal on OS X, you can change this in the settings on the Advanced tab. Declare terminal as parameter:

enter image description here

+2
source

All Articles