On Wed, Jun 5, 2013 at 4:39 PM, Andy Lester <
an...@petdance.com> wrote:
> Back in commit b34f2e6e I merged in a bunch of Hinrik Örn Sigurðsson's
> changes to the main vim-perl project. One big part of that was switching
> from using "syn keyword" to "syn match" for identifying Perl keywords.
>
> Can anyone (Hinrik, the list) tell me the reason for doing this? Was there
> a benefit to using syn match?
I don't know if this was the reason, but in general keyword can be bad
for anyone trying to extend an existing syntax, because:
1. It always takes precedence over match or region items, even if the
match or region is defined last.
2. It cannot contain any other items.
From the help:
5. Defining a syntax *:syn-define* *E410*
Vim understands three types of syntax items:
1. Keyword
It can only contain keyword characters, according to the 'iskeyword'
option. It cannot contain other syntax items.
and
PRIORITY *:syn-priority*
When several syntax items may match, these rules are used:
1. When multiple Match or Region items start in the same position, the item
defined last has priority.
2. A Keyword has priority over Match and Region items.
3. An item that starts in an earlier position has priority over items that
start in later positions.