I have a very simple Vim syntax file for personal notes. I would like to highlight the name of the people, and I chose a syntax like Twitter @jonathan .
I tried:
syntax match notesPerson "\<@\S\+"
In the meaning: words starting with @ and having at least one character without spaces. The problem is that @ appears to be a special character in Vim regular expressions.
I tried to exit \@ and bracket the [@] regular tricks, but that didn't work. I could try something like (^|\s) (beginning of line or space), but it is precisely the problem that the word boundary is trying to solve.
Highlighting works on simplified regular expressions, so it's more about finding the right regular expression than anything else. What am I missing?
jpalardy
source share