2

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.

4

1 回答 1

4

您可以syntax match使用正则表达式来包含可选的空格:

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

请注意,这与 不完全相同syntax keyword因为keyword具有更高的优先级。在实践中,它很少重要。

于 2013-11-14T22:52:28.043 回答