I'm trying to write some matching rules in a Vim syntax file to highlight indented bullets. My problem is that the syntax highlighting uses a background color, so I would like to match only the bullet character and not the preceding whitespace.
How can I say "match \d., +, -, and * only if preceded by ^\s\{0,1} (but do not match the whitespace)"
With the following matching rules,
syn match notesBullet /^\s*\*/
hi def link notesBullet String
syn match notesNumber /^\s*\d*\./
hi def link notesNumber String
syn match notesMinus /^\s*\-/
hi def link notesMinus Todo
syn match notesPlus /^\s*+/
hi def link notesPlus Plus
I get the following result:
Is there some way to say "if preceded by, but not including" in Vim regex?