Charles E Campbell Jr wrote:
Robert Hicks wrote:
A word can be anything really, so it would be from "-" to the end.
So something like:
syn match MyVarOption "\<-\w\+\>"
Unless - is part of normal keyword characters (see :he 'iskeyword'), the
\<- isn't going to help.
Probably you want
syn match MyVarOption "\%(\s\|^\)\zs-\w\+\>"
According to the isk help file "-" is a keyword character. I am trying
to update the Tcl syntax file a bit. Tk has lots of options that start
with the "-" character. I was hoping that the above would make it easy
to highlight all of the options without a lot of fuss.
Is it possible to create a keyword group and then do a match with those
words and if they are prefixed with a "-" to color them a certain way? A
couple of the actual ones would be:
-command
-menu
-fill
-pady
-padx
-tearoff
-label
-text
-height
-width
-justify
and the list goes on. And you can see why I was hoping a simple match
would do it. :-)
:Robert