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:
The Vim color scheme I am currently using is Jellybeans, and I have located its file at ~/.vim/colors/jellybeans.vim
开发者_StackOverflow.
What should I change in that color scheme file to get rid of the background highlighting around some of the text?
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.
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
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.
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.
精彩评论