1

Suppose I have these Vim definitions:

syn match tasktag "\(\s\)\@<=@[a-zA-Z0-9_]\+"
syn match taskdone "\<[Dd]one\>" containedin=tasktag

How do I specify taskdone to highlight the entire text in the line? I looked at :h syn-pattern-offset as well as :h syn-region.

1 Answer 1

0

First, your "tasktag" match does not allow spaces or other "word delimiters", yet your "taskdone" match requires "done" to be a discrete word because of your \< and \> word boundary atoms.

Second, your "taskdone" match is written to only highlight the word "Done".

Assuming I properly understand what you want, I modified your two matches:

syn match tasktag "\(\s\)\@<=@[a-zA-Z0-9_ ]\+"
syn match taskdone "@.*\<[Dd]one\>.*" containedin=tasktag

If you haven't done so already, you will need to specify the highlighting for the two matches. For example:

highlight link tasktag TODO
highlight link taskdone Statement

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .