突出显示预处理器DEBUG块

时间:2011-02-26 08:58:06

标签: vim

我想突出显示#ifdef DEBUG#endif

之间的所有内容

我试过了:

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

但它没有强调DEBUG块。有什么想法吗?

1 个答案:

答案 0 :(得分:2)

您必须使用region代替match,如下所示:

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

相关帮助文件为syn-matchsyn-region

相关问题