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
.csonto.json. - Convert
.jsonto.yaml. - Convert
.yamlto.tmLanguageusing https://github.com/jtojnar/relaxdiego-sublime-tools. - Fix the XML processing instruction in the generated
.tmLanguageto use double quotes instead of single quotes. - Convert the
.tmLanguageto.sublime-syntaxusing 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.)