开发者

highlight preprocessor DEBUG blocks

I want to highlight everything between #ifdef DEBUG and #endif

I tried this:

syntax match DEBUG /#ifdef DEBUG.*?#endif/
hi DEBUG ctermfg=green ctermbg=white

But it doesn't highlight the DEBUG blocks开发者_StackOverflow社区. Any ideas?


You have to use region instead of match like this:

syntax region DEBUG start=/#ifdef DEBUG/ end=/#endif/

The relevant help files are syn-match and syn-region.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜