在曝光的vim中出现奇怪的色彩

时间:2013-09-10 08:27:44

标签: vim color-scheme

我已经为Vim安装了Solarized,以及我的终端应用程序,但是遇到了奇怪的背景颜色。我在Debian 6上运行Vim 7.2的macerm2和Redhat EL5.9上运行Vim 7.3的win7上看到了相同的问题。

症状:代码与行号具有相同的背景。只有字符串和保留字才能获得正确(较浅)的背景色。

以下是显示问题的图片:

enter image description here

这就是它的外观(来自Solarized主页的截图):

enter image description here

知道是什么原因引起的吗?

2 个答案:

答案 0 :(得分:1)

使用 PuTTY ,我必须将Terminal-type string(在连接,数据下)设置为xterm-256color而不是xterm

答案 1 :(得分:1)

Issue 130 answers this (perhaps it is you?)

If I use PuTTy with the default settings ( not changing to putty-256color ) then the colors are not correctly allocated.

I noticed this line

elseif g:solarized_termcolors != 256 && &t_Co >= 16

checks to see if t_Co > = 16 but Putty identifies itself or at least the variable is 8 which causes the else statement to run.

If I change that statement to:

elseif g:solarized_termcolors != 256 && &t_Co >= 8

then everything works as it should. I don't know how this would affect other terminals but I thought you should know that this is indeed broken and changing that value or adding another conditional would fix this problem.

As a fix in the meantime if anyone has this problem they can simply set t_Co to equal 16 in their vimrc and that appears to fix the problem.