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