我有一个Ubuntu 17.04系统,Tmux版本为2.3,Vim版本为8.0,并且使用了一个名为onedark的颜色方案。当我不在TMUX中时,Vim显示正确的颜色方案,但当我在TMUX中时,Vim看起来完全不同。我已经尝试在.bashrc、.vimrc和.tmux.conf中进行了各种配置,但没有成功。最近我发现,如果我在Tmux中以root(administrative)权限运行vim,则一切都按预期工作,但我认为这并不是一个好的解决方案。所以我的问题是,如何使Vim在具有或不具有root权限以及在TMUX内外时都显示一致的颜色方案。我的与颜色相关的配置如下:.tmux.conf
set-option -sa terminal-overrides ",xterm*:Tc"
set -g default-terminal "xterm-256color"
.vimrc
set encoding=utf-8
set nocompatible
set t_Co=256
set t_ut=
set background=dark
set showmatch
syntax on
if (empty($TMUX))
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
endif
colorscheme one
如果在tmux内或外执行echo $TERM
命令,我得到的结果是xterm-256color
termguicolors
设置,但没有在 Tmux 中启用? - Alexander Batischev