Convert .tmLanguage or Atom CSON grammar to .sublime-syntax file
September 24, 2023 ◦ 2 min ◦
I needed to convert an Atom CSON grammar to a Sublime Text .sublime-syntax
file.
The process turned out more complicated than I expected, boiling down to these steps on my first go:
- Convert
.cson
to.json
. - Convert
.json
to.yaml
. - Convert
.yaml
to.tmLanguage
using https://github.com/jtojnar/relaxdiego-sublime-tools. - Fix the XML processing instruction in the generated
.tmLanguage
to use double quotes instead of single quotes. - Convert the
.tmLanguage
to.sublime-syntax
using https://github.com/aziz/SublimeSyntaxConvertor.
Since this was fairly tedious, this article provides a simpler way to do all of this in one go, regardless of if your source-file is an Atom CSON grammar or a .tmLanguage
file.
Just paste your Atom CSON or .tmLanguage
document into the box below and the .sublime-syntax
file will be generated for you.
(The conversion is happening entirely client-side, no requests to any external servers are made.)