I am trying to set up a script for the conceal feature to prettify strings in Python. This worked fine so far for single word substitutions. But now I would like to replace "not in" with "∉". I tried this:
syntax match pyOperator "not in" conceal cchar=∉
But that does not match anything and I don't see why not. e.g.
x not in l stays x not in l
However
syntax match pyOperator " not in " conceal cchar=∉
works. But I want the former version, as this one makes
x not in l to x∉l, hiding the spaces.
Why does the second version work and the first does not and how can I make it work?
btw. I also tried other variants, such as
syntax match pyOperator "\s\+not\s\+in\s\+'" conceal cchar=∉
That one does not work t all either, which also puzzles me, as t is a superset of the second version.
It is being blocked by the
syntax keyword pythonOperator and in is or notdefinition, which seems to take precedence oversyntax match(and doesn't allow for overlap). So we'll clear out that definition, and replace it with an equivalentsyntax matchone.I also changed your
pyOperatorto the standardpythonOperator; one reason is that it's already there (forin,and,is,orandnot, as seen above); the other reason (from:help 44.2):