开发者

how to find out where a vim highlighting is defined?

开发者 https://www.devze.com 2023-01-26 13:01 出处:网络
I\'m trying to change the highlighting in vim for the highlighting group \"Folded\". I\'m using the color scheme \"koehler\" and my folded lines appear in cyan on a grey background in gvim, which is c

I'm trying to change the highlighting in vim for the highlighting group "Folded". I'm using the color scheme "koehler" and my folded lines appear in cyan on a grey background in gvim, which is completely unreadable. I thought I could edit the :highlight command responsible for this group in the koehler.vim color scheme file but there is no definition for "Folded" in that file.

I verified that I have color scheme koehler loaded:

:echo g:colors_name
koehler

Then I listed all the highlighting groups with a command I found in another post:

:so $VIMRUNTIME/syntax/hitest.vim   

Highlighting groups for various occasions
---------------------------开发者_如何学JAVA--------------
[...]
Folded  Folded
FoldColumn  FoldColumn
[...]

The "Folded" group is shown in the ugly colors I also see in my files. The file I was editing was a "viki" file but I get exactly the same with a perl script, so the highlighting for "Folded" must be defined somewhere central. I don't have any :hilight commands in my .vimrc.

How can I find out where this group is defined?


Using

:verbose hi Folded

You should be able to display where the Folded attribute was last modified. (Usually the answer is the active colorscheme file)


(hitest.vim doesn't tell you where anything is defined. Just what is defined and grouped.)

That looks like it's probably the default setting. You can override it in a colorscheme (the easiest way is to copy $VIMRUNTIME/colors/koehler.vim to ~/.vim/colors/koehler.vim and add the lines), like this:

hi FoldColumn      guifg=#465457 guibg=#000000
hi Folded          guifg=#465457 guibg=#000000

(That example is taken from the theme I use, molokai, which has fairly nice folding colors.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号