定义新的vim语法时出错

时间:2014-10-24 20:20:27

标签: vim vim-syntax-highlighting

为什么此行能够正确地突出显示(**)之间的所有内容作为vim中的评论?

syn region   datsComment start="(\*" end="\*)" contains=datsComment,datsTodo
hi def link datsComment Comment

1 个答案:

答案 0 :(得分:1)

它适用于我(在没有其他语法定义的新缓冲区中)。你可能还有其他语法元素阻止匹配。

您需要找出导致该问题的语法组。 :syn list显示所有活动组,但在安装SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor插件时更容易。如果您发现其他语法组模糊了匹配,您可能应该将它们包含在contains=datsComment,datsTodo,...部分中。