I'm trying to add this rule:
syn match Keyword /{+.*+}/ If I open a plain text file and run the above as a command, it works: stuff like {+ asdf +} gets highlighted as a keyword.
However, if I add this to a syntax file, or I run this after opening a syntax-highlighted file such as a Git diff, it does nothing. Try as I might, I can't get it to highlight the matched parts.
If I do :sy clear in a Git diff file and add the match rule as a command, it works. Is something in the existing syntax definition perhaps preventing further rules from working/being added?
I can see (using this mapping) that the text I'm trying to highlight is not currently part of any syntax item—in other words, the text is the default text colour not because it is assigned that way, but because it is assigned to nothing at all.
For what it's worth, I'm using MacVim, which seems to have a built-in Git syntax definition that is loaded after all my other syntax files—not that editing that file makes any difference here. I just tried this with NeoVim as well, with no success.