Вопрос

I would like to create a vim syntax file where either:

  1. White space is included in keywords.
  2. White space is ignored in keywords.

Either would work for my purpose, which is to create a JMP scripting language (JSL) syntax file. In JMP, whitespace is ignored in keywords, so New Column("Col1") and NewColumn(Col1`) are identical. The former format, with the space, is the standard.

Это было полезно?

Решение

You can syntax match with a regular expression to include optional whitespace:

:syntax match GROUPNAME /\<New\s*Column\>/

Note, that this is not quite the same as syntax keyword, because keyword has higher priority. In practice, it rarely matters.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top