Reputation: 95
When I run vim in tmux
, the syntax highlighting works fine except for the visual mode, it works but doesn't change the colors of the selected text, which I find quite annoying.
The problem stays the same even when I switch the colorscheme(I am currently using molokai) I have the option set t_Co=256 on my vimrc My .tmux.conf file is the same as the t-williams.conf example(just added the line "set -f default-terminal "xterm"")
I already tried some solutions to problems related to the 256 color support
any tips?
Upvotes: 9
Views: 6545
Reputation: 46420
Make sure your terminal declares itself as a 256 color supported terminal (for example, xterm-256color
). This will set the TERM
in bash, which is read by tmux, and will automatically set the default-terminal
setting to screen-256color
.
For example, in the Terminal on OS X you can change this in the settings under the "Advanced" tab. The "Declare terminal as" option:
Upvotes: 4
Reputation: 196906
The recommended setting for tmux is
set -g default-terminal "screen-256color"
and you don't need
set t_Co=256
in your ~/.vimrc
.
Upvotes: 10