Find out to which highlight-group a particular keyword/symbol belongs in vim

后端 未结 3 1348
南方客
南方客 2020-12-08 15:34

I am coming to Vim from TextMate, and I would like to customise my vim colorscheme. It would be really helpful if I could find out to which highlight-group(s) any particular

3条回答
  •  萌比男神i
    2020-12-08 16:09

    Another way to get lots of information about the highlighting:

    map  :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#")
    

    If I move over a comment in a C file and press F3, I get:

    hi trans lo FG:#00ff00
    

    which shows that it is in the highlight group cCommentStart, which is linked to Comment and coloured in green (#00ff00). This is (modified) from here, see that page for more information.

提交回复
热议问题