SublimeText. Highlighting similar keywords - in different colors

72 Views Asked by At

How can i do this in SublimeText (see the image below)?

image

Is it possible do by using .sublime-syntax (%YAML1.2) or maybe another way?

Will be wonderful if anyone can provide me with some example. Thanks.

1

There are 1 best solutions below

0
FMarkus On

Ok, nobody knows. This small example how it may works.

%YAML 1.2
---
name: MyCustomSyntax
file_extensions: txt
scope: source.txt

contexts:
  main:
  - comment: "mykey operator definition"
    match: mykey(?= *?= *?\{)
    scope: keyword.txt

  - comment: "mykey structure definition"
    match: mykey(?! *?= *?\{)
    scope: string.txt

  - comment: "other operator definition"
    match: (=|{|})
    scope: comment.txt