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
.
精彩评论