Hi,

So you want something like:

  " highlight all var options using this match
  syntax match allVarOptions "\%(\s\|^\)\zs-\w\+"

  " highlight the keywords within allVarOptions:
  " note: because '-' is an iskeyword character, you have to
  " use a match instead.
  syntax match allVarOptionKeywords contained containedin=allVarOptions
  \ "\v%(command|fill|pady|padx|)"

Hope that helps,

regards,
Peter


--- Robert Hicks <[EMAIL PROTECTED]> wrote:

> 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
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 

Reply via email to