问题描述
限时送ChatGPT账号..我正在运行 iterm2,当我处于 tmux 模式时,我在 vim 中设置的颜色方案没有显示.只有我在 iterm 中设置的配色方案.如果我从 shell 运行 vim,颜色方案看起来是正确的 - 只有当我处于 tmux 模式时.
I'm running iterm2 and when I'm in tmux mode the colorscheme I have set in vim does not show up. Only the color scheme I've set in iterm. If I run vim from shell the colorscheme appears correct - its only when I'm in tmux mode.
我试过在 vim 中设置 :colorscheme molokai
(见下面的截图)并且它没有改变 - 同样,iterm2 的默认颜色方案仍然存在.
I've tried setting :colorscheme molokai
when in vim (see screenshot below) and it doesn't change - again, the default colorscheme for iterm2 remains.
我是否缺少 iterm 或 tmux.conf 的某些设置?我的 dotfles 在 github 上.
Am I missing some setting to iterm or tmux.conf? My dotfles are up on github here.
推荐答案
我遇到了同样的问题.唯一的区别是我使用的是 solarize
而不是 molokai
.
I had the same problem. Only difference was I am using solarize
rather then molokai
.
为了解决这个问题,我在~/.bashrc
中设置了一个别名:
To fix the issue, I have set up an alias in ~/.bashrc
:
alias tmux="TERM=screen-256color-bce tmux"
并在~/.tmux.conf
中设置default-terminal
选项:
set -g default-terminal "xterm"
最后,执行 $ source ~/.bashrc
加载新别名.
Lastly, do $ source ~/.bashrc
to load new alias.
这篇关于在 tmux 模式下丢失 vim 颜色方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论