Charles E Campbell Jr wrote:
<snip>
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. :-)


You can get the effect I think you want with:

syn match OptionMatcher "\%(^\|\s\)\zs-\w\+" contains=SpecificOptionList,OptionStarter syn keyword SpecificOptionList contained command menu fill pady padx tearoff label text height width justify
syn match OptionStarter contained "-"

hi link OptionMatcher Error
hi link SpecificOptionList Statement
hi link OptionStarter SpecificOptionList

These commands will highlight your options; ones that aren't in the keyword list (ex. -junk) would get highlighted as Error.

Well that kind of worked. Every word that start with "-" is highlighted as an "Error", including those in the "SpecificOptionList".

:Robert

Reply via email to