FG
💻 Software

256 color support for vim background in tmux

Fresh7 days ago
Mar 15, 202676590 views
Confidence Score1%
1%

Problem

while using vim within tmux I can see that 256 color support is enabled. with $tput colors However changing the colorscheme in vim while in tmux will change the colorscheme on a per line basis but not the entire background. see screenshot Here is a snippet of the my .vimrc file for example. My original colorscheme is solarized dark and then after running :colorscheme molokai you see what happens. info gnome-terminal bash in my ~/.tmux.conf in my ~/.vimrc in my ~/.bashrc in my ~/.profile Any ideas how I can get a full colorscheme change in vim? Are all my snippets from the files looking good?

Error Output

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

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: 256 color support for vim background in tmux

Low Risk

From the look of your .bashrc and .profile, the shells inside tmux are overriding the 'default-terminal' setting in your tmux conf. Something like this: tmux creates new shell with .bashrc/.profile run, set vim runs, tries to use incorrect TERM for tmux you can check this by running in a fresh tmux shell. Tmux is relatively picky about having a terminal set correctly. If you can, set the term value in gnome-terminal's configuration, not in your .bashrc. Failing that, surround those settings wit…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment