VIM 未在 tmux 中使用正确的配色方案

V3n*_*mXP 2 vim vim-plugin tmux

我已经提到过这个问题,并且尝试了许多建议的更改,并且暂时有效。我将我的 Ubuntu 机器更新到最新版本,它破坏了我的 tmux。 在 tmux 模式下丢失 vim 颜色方案

目前,在 tmux 之外一切正常,但 tmux 中的 vim 有问题。

我的 vimrc :

call plug#begin('~/.vim/plugged')
Plug 'arcticicestudio/nord-vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
call plug#end()

set termguicolors
set hlsearch
syntax on
colorscheme nord
Run Code Online (Sandbox Code Playgroud)

我在 bashrc 中设置了这两个变量

export TERM="xterm-256color"
alias tmux='tmux -2'
Run Code Online (Sandbox Code Playgroud)

一个 ans 建议将其添加set -g default-terminal "xterm"到 tmux.conf 中,但添加此操作会丢失我的 tmux 中的所有颜色。

我正在使用这个https://github.com/lemnos/theme.sh来设置我的终端的颜色方案。

我不明白我做错了什么。

小智 10

我自己最近也遇到了这个问题。当将你的配置文件与我的配置文件进行比较时,我比你多了几行。

tmux.conf:

set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
Run Code Online (Sandbox Code Playgroud)

vimrc

set term=xterm-256color
Run Code Online (Sandbox Code Playgroud)