This is a repost from stackoverflow at the suggestion of a user to this vim-specific forum.

I am trying to use a vim syntax file for highlighting a PyMOL script file and got into trouble with the "syntax cluster" definitions, the vim files are from https://github.com/speleo3/PyMol-syntax . The definitions that give trouble are:

syntax keyword pymolOperatorK  and or not
syntax match pymolOperator1 "[!|&,()?]"
syntax cluster pymolOperator contains=pymolOperator1,pymolOperatorK
hi def link pymolOperator Operator

When editing a PyMOL file (syntax file properly loaded and other parts properly highlighted), the keywords "and, or, not" are not properly highlighted. However, if I add the following two lines, then the highlighting is working:

hi def link pymolOperator1 Operator
hi def link pymolOperatorK Operator

Basically, it looks like the "syntax cluster" part is not working.

There is another "syntax cluster" line defined, the "pymolString" group, which has the same issue, only after I add "hi def link" individually does the corresponding highlighting work.

I also tried to move the "syntax cluster" definition before the "syntax keyword" line, still did not work.

Any comments?


1 Answer 1


"Cluster" is a logical unit. The text elements are still bound to ordinary syntax items, such as pymolOperatorK.

You must create highlighting links manually, e.g.

hi def link pymolOperatorK pymolOperator
hi def link pymolOperator1 pymolOperator
hi def link pymolOperator Operator
  • Thanks for the explanation. That makes sense now.
    – whytong
    Jan 26, 2021 at 2:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.