I have these rules in a custom syntax file.
syn match id '\w\+'
syn keyword _type void int bool string list nextgroup=id
I only want id to be matched after a _type.
You're already close.
contained.nextgroup=..., the match must begin exactly after the end of the current group. Therefore, you need to include the leading whitespace in the id group match: \s\+, or add skipwhite.my... here.:syn match myId '\w\+' contained
:syn keyword myType void int bool string list nextgroup=myId skipwhite
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With