在使用 zsh 的 Vim 中,solaris 方案的背景太浅
我想使用 solarized,它在 Vim 中提供了不错的配色方案。它的工作原理是在 gnome-terminal 中设置 16 种颜色的 ansi 颜色。如果我在 bash 中使用 Vim,它工作得很好,但在 zsh 中颜色不亮。有些字母的背景正确,但大多数字母的背景太浅。 zsh 为何会干扰 Vim 显示的 ansi 颜色?
I want to use solarized, which gives a decent color scheme in Vim. It works by setting the 16 colors ansi colors in the gnome-terminal. It works fine if I use Vim from bash, but in zsh the colors are off. Some letters have the right background, but most have too light background. What is it about zsh that interferes with the ansi colors as displayed by Vim?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我无法重现这个 - 如果这仍然是一个问题,也许给出
~/.bashrc
、~/.zshrc
、~/.vimrc 的相关部分
等可能会有所帮助。我正在使用 Solarized
vim
颜色方案,并且以下链接的 Gnome-Terminal 设置截图。正如您所看到的,它们看起来是相同的 - 我注意到zsh
或vim
中肯定没有颜色问题(我不使用bash
多)。我的
zsh
设置取自oh-my-zsh< /code>
,我的提示符是 Phil! 的 ZSH 提示符<的破解版/a> (我弄乱了 Phil! 的 ZSH 提示符的颜色,因为它与 Solarized iTerm2 颜色配合得不好)。但是,我认为我没有搞乱任何会影响
vim
中bash
和zsh
之间的 Solarized 着色的东西。当然,下面两个屏幕截图中的vim
设置是相同的。I can't reproduce this - if this is still an issue, perhaps giving relevant sections of
~/.bashrc
,~/.zshrc
,~/.vimrc
etc might help.I'm using the Solarized
vim
colorscheme, and the linked Gnome-Terminal settings in the following screenshots. As you can see, they appear to be identical - there's certainly no color issues in eitherzsh
orvim
that I've noticed (I don't usebash
much).My
zsh
settings are taken fromoh-my-zsh
, and my prompt is a hacked-up version of Phil!'s ZSH prompt (I have messed with the coloring of Phil!'s ZSH prompt, because it didn't play well with the Solarized iTerm2 colors). However, I do not think I've messed with anything that would affect the Solarized colorings betweenbash
andzsh
invim
. Certainly thevim
settings are identical between the two screenshots below.我在 Ubuntu 14 上使用 zsh 遇到了同样的问题。
这修复了它(在 .vimrc 中)
I had the same problem on Ubuntu 14 with zsh.
This fixed it (in the .vimrc)
我知道这是一个非常老的问题,但我遇到了同样的问题并遇到了这个,所以我认为如果我回答它,它仍然对某人有用。
对我来说,
TERM
没有像在bash
中那样在zsh
中设置为xterm-256color
,所以颜色很混乱在vim
中。只需将
export TERM=xterm-256color
添加到.zshrc
文件即可解决该问题。I know this is a veeery old question but I had the same problem and came across this so I thought it could still be useful to someone if I answered it.
For me
TERM
was not set toxterm-256color
inzsh
like it was inbash
so the colours were messed up invim
.Simply adding
export TERM=xterm-256color
to the.zshrc
file fixed the problem.