设置 Vim 背景颜色 [英] Setting the Vim background colors
问题描述
当我尝试在 .vimrc
或直接在 Vim 中使用以下命令更改背景颜色时:
When I try to change the background colors in .vimrc
or directly in Vim using the command:
set background=dark
...它根本不影响我的背景.light
选项也没有.但是,当我运行 gvim 时,它看起来没问题.
... it doesn't affect my background at all. Neither does the light
option. However, it looks okay when I run gvim.
有没有办法在不改变我的 Konsole 设置的情况下改变 Vim 中的背景?
Is there a way to change the background in Vim without changing my Konsole settings?
EDIT 好的,guifg/guibg 和 ctermfg/ctermbg 是有区别的.虽然 GUI 接受许多不同的颜色组合,但 cterm 只允许少数标准组合.
EDIT Okay, there is a difference between guifg/guibg and ctermfg/ctermbg. While the GUI accepts lots of different color combinations, cterm allows only few standard ones.
推荐答案
正如 vim 自己在 set background
上的帮助所说,设置这个选项不会改变背景颜色,它告诉 Vim 背景是什么颜色看起来像.关于改变背景颜色,见|:hi-normal|."
As vim's own help on set background
says, "Setting this option does not change the background color, it tells Vim what the background color looks like. For changing the background color, see |:hi-normal|."
例如
:highlight Normal ctermfg=grey ctermbg=darkblue
将在您的彩色终端上以白底白字书写.
will write in white on blue on your color terminal.
这篇关于设置 Vim 背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!