Skip to content

Instantly share code, notes, and snippets.

@MaisaMilena
Last active July 10, 2019 22:28
Show Gist options
  • Save MaisaMilena/ba5ba8e3b553b9219eddfc306d8c2b19 to your computer and use it in GitHub Desktop.
Save MaisaMilena/ba5ba8e3b553b9219eddfc306d8c2b19 to your computer and use it in GitHub Desktop.

Creating a Textmate

I highly recommend using Iro when creating a new language syntax highlight. It allows a simple interface for defining rules and generates files for Textmate (plist), Atom, Ace, Sublime3.

References for Textmate:

Regex and scope naming

Obs: some of them doesn't work directly on Debuggex, but works in the IDE (e.g: VSCode)

Scope naming Regex Example
keyword.operator.logical `(<= >=
keyword.operator.arithmetic `(- +
keyword.conditional `\bif\s \bthen[\s
constant.numeric.integer.binary (\b[01]+\b) 10010
constant.numeric.integer.octal (^0[0-7]+$) 07
constant.numeric.integer.decimal (^[\d.]+$) 70
constant.numeric.integer.hexadecimal `(0[a-z A-Z][0-9a-fA-F]+)`
constant.numeric.float `[+-]?((\d+.?\d*) (.\d+))`

Examples of textmate:

Example of Iro:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment