如何在 Vim 中更改 Jellybeans 配色方案中某些文本对象的彩色背景?
我曾经使用 gVim,但现在我切换到终端 Vim 并希望摆脱一些在某些文本下呈现的烦人的背景突出显示.以下是我正在谈论的一些示例:
I used to use gVim, but now I am switching to terminal Vim and would like to get rid of some annoying background highlighting which is being rendered under certain text. Here are some examples of what I am talking about:
我目前使用的 Vim 配色方案是 Jellybeans,我在 ~/.vim/colors/jellybeans.vim
找到了它的文件.
The Vim color scheme I am currently using is Jellybeans, and I have located its file at ~/.vim/colors/jellybeans.vim
.
我应该在该配色方案文件中更改哪些内容以消除某些文本周围的背景突出显示?
红色和紫色背景的文字片段可能是拼写错误.您使用的配色方案未配置突出显示拼写错误,所以默认是活动的.
The pieces of text on red and violet background are probably spelling errors. The color scheme you use does not configure the highlighting for spelling errors, so the default one is active.
有四个高亮组负责拼写错误’外观:SpellBad
、SpellCap
、SpellRare
、SpellLocal
(见:help 拼写快速入门
).这些组的默认选项是定义如下:
There are four highlighting groups responsible for spelling errors’
appearance: SpellBad
, SpellCap
, SpellRare
, SpellLocal
(see
:help spell-quickstart
). The default options for these groups are
defined to be something like the following:
:hi SpellBad term=reverse ctermbg=224 gui=undercurl guisp=Red
:hi SpellCap term=reverse ctermbg=81 gui=undercurl guisp=Blue
:hi SpellRare term=reverse ctermbg=225 gui=undercurl guisp=Magenta
:hi SpellLocal term=underline ctermbg=14 gui=undercurl guisp=DarkCyan
您可以将这些组的突出显示设置更改为您的喜欢,然后附加相应的 :highlight
命令到自定义配色方案文件.
You can change the highlighting settings of these groups to your
liking, and then append the corresponding :highlight
commands
to a custom color scheme file.
请注意,也可以手动运行 :highlight
命令并即时体验外观的变化,以找到合适的无需重新加载整个配色方案文件.
Note that it is also possible to run :highlight
commands manually
and experience changes in appearance on the fly, to find the right
colors without reloading the whole color scheme file.