I want to customize a syntax coloring in vim for c++. But, unfortunately, i still can’t find a correct name for braces (){}[] and operators +-/*% for c/c++/objc/objcpp. Any vim guru whi can suggest what name i must ‘hi’ in order to set color for items mentioned?
Share
I believe that there is no default highlighting for braces as standard in vim for C code or derivative languages (they’re just highlighted as plain text). You could define your own, using something like:
or you could download the rainbow brace highlighting plugin, which gives varying colours for different levels of indentation. See also my answer to this question.
There is a screenshot of the rainbow brace highlighter in action (with my Bandit colour scheme) here.
Edit:
In order to find out the highlighting group of anything that interests you, create this mapping:
(taken from here). Then, move the cursor over whatever you’re interested in and press F3. If it’s not highlighted at all, Vim will print:
If there’s a particular highlight group, you’ll get something like this (with the cursor over the
ifkeyword):which tells you that the highlight group is called
cConditionaland that it is linked (with:hi link) to the group calledConditional. With rainbow brace highlighting, you may get something likecCurly1, which means it’s inside a curly brace, but with no additional highlighting.Edit 2:
A possible operator matcher (not very well tested):