开发者

highlight preprocessor DEBUG blocks

开发者 https://www.devze.com 2023-02-14 02:22 出处:网络
I want to highlight everything between #ifdef DEBUG and #endif I tried this: syntax match DEBUG /#ifdef DEBUG.*?#endif/

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

精彩评论

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