我在自定义语法文件中有这些规则。
syn match id '\w\+'
syn keyword _type void int bool string list nextgroup=id
我只要
id
在 _type
之后匹配.
最佳答案
你已经接近了。
contained
. nextgroup=...
,比赛必须恰好在当前组结束后开始。因此,您需要在 id 组匹配中包含前导空格:\s\+
,或添加 skipwhite
. my...
这里。 :syn match myId '\w\+' contained
:syn keyword myType void int bool string list nextgroup=myId skipwhite
关于vim - 仅在语法文件中将突出显示规则作为下一组运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16227271/