在 tmux 模式下丢失 vim 颜色方案 [英] lose vim colorscheme in tmux mode

查看:23
本文介绍了在 tmux 模式下丢失 vim 颜色方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆