views:

615

answers:

1

Hello.

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?

+4  A: 
Al
Thanks for braces, it's good to know that they are not highlighted and i don't required to hack through c.vim :). And what about operators like +-/*%^ etc?
Eye of Hell
Most operators don't seem to be highlighted by default. I've added a description of an easy (once you've defined a mapping) way of finding out the highlight group of the keyword or symbol under the cursor. That's how I found out the answer to your question...
Al
A similar ":syn match" line could be used if you want to highlight operators: syn match Operator display '[+-/*%^]'
Al
I've added a rather complicated possible operator matching script. It isn't simple (and it's probably not exactly right) but it should match things like <<=, << and !=, but not !==, ===, ---, <=> etc. I wrote it as the closest thing that vim has to "Verbose Regular Expressions" as it's too complicated as a single line version.
Al