在 tmux 模式下丢失 vim 颜色方案

编程入门 行业动态 更新时间:2024-10-27 16:25:24
本文介绍了在 tmux 模式下丢失 vim 颜色方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-01 15:55:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/834267.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:颜色   方案   模式下   tmux   vim

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!