Monday, June 27, 2011

Re: "Extending" syntax files / overriding keyword with match

On Jun 26, 3:56 pm, "Benjamin R. Haskell" <v...@benizi.com> wrote:
> >    syn keyword fooGroup foo bar baz
>
> > and I want to override it as:
>
> >    syn match fooGroup /somepattern/
>
> > Is there a way to "unset" a group name as if it were never defined?
>
> syn clear fooGroup
>
> :help :syn-clear
>
> > Or is there at least a way to give match precedence over the keyword
> > for that group name?
>
> I don't see the problem in your example.  In the actual situation, are
> the two 'fooGroup's different?
>

From just below :help :syn-keyword :

A keyword always has higher priority than a match or region, the
keyword is used if more than one item matches. Keywords do not nest
and a keyword can't contain anything else.

So no, you cannot give the match precedence.

But it looks like you can use :syn clear fooGroup as suggested, prior
to the :syn match command.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment