tags:

views:

127

answers:

1

In the latest Vim:

Is there a way to define a '{' such that it's ignored by the C/C++ compiler (g++) but treated like a '{' in Vim synatx highlighting?

I've tried //{ but it's ignored by Vim too.

+1  A: 

The whole point of syntax highlighting is to help indicate how the compiler will interpret your code. For example, if you miss a closing quote on a literal string, the syntax highlighting helps you to identify where you did that.

You're asking for a vim feature to do something that it's expressly designed to avoid doing.

Greg Hewgill
I'm doing a fragment macro.Vim is misinterpreting my code.
anon
@anon: wouldn't have hurt to see example code.
MSalters