Robert Hicks wrote:
Tim Chase wrote:
I would like to match all "options" that start with a hyphen like:
-one
-two
So all those would be a match from the "-" to the end of the word.
Looks like a simple
/\<-\w\+\>/
It makes some presumptions where your description falls silent. What
constitutes a "word" for you? The vim defintion of a word is embodied
by the "\w" atom. However, it includes numbers and an underscore. If
that's no good, you can change the "\w" to the set of desired
characters with a character-class
/\<-[a-zA-Z]\+\>/
Adjust accordingly.
-tim
A word can be anything really, so it would be from "-" to the end.
So something like:
syn match MyVarOption "\<-\w\+\>"
:Robert
I should say this is for a syntax file...so it needs to work from that.
:Robert