vim 颜色方案不改变背景颜色 [英] vim colorschemes not changing background color

查看:47
本文介绍了vim 颜色方案不改变背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 vim 中应用我在网上看到的各种配色方案.无论我选择什么方案,背景都保持白色,即使应用方案的屏幕截图显示背景应该是彩色的.

I try to apply various color schemes in vim that I have seen on the net. Whatever scheme I choose, the background remains white, even though screenshots of the applied scheme shows that the background should be colored.

在某些方案中,某些背景会改变颜色,但包含文本的行的右侧空间仍然保持白色.

In some schemes, some of the background change color, but space right of lines containing text still remains white.

我在 Mac 上使用 Vim 7.2.我刚刚开始使用非 gui 应用程序,所以一切都应该是开箱即用的.

I'm using Vim 7.2 on a mac. I have just started messing with non-gui applications, so everything should be pretty much as it was out of the box..

终端窗口的整体设置是否与此有关?

Does the overall settings for the terminal window have something to do with it?

运行 macvim 时,一切正常.只有当从终端启动 vim 时,事情才看起来很奇怪..

When running macvim, everything looks ok. Its only when starting vim from the terminal things looks strange..

推荐答案

我的 .vimrc 中有这个,它为我在使用 PuTTY 时解决了这个问题.

I have this in my .vimrc and it solved this problem for me using while using PuTTY.

set t_Co=256
set background=dark
colorscheme mustang
highlight Normal ctermbg=NONE
highlight nonText ctermbg=NONE

在.vimrc 中的ctermbg 设置之前加载colorscheme 很重要,因为它们需要覆盖colorscheme 设置的相同设置.这也意味着你不能在 Vim 运行时切换配色方案并期望它工作.

It's important to load the colorscheme before the ctermbg settings in .vimrc because they need to override the same ones set by the colorscheme. This also means you can't switch colorscheme while Vim is running and expect it to work.

这篇关于vim 颜色方案不改变背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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