Use vim syntax definition with sublime-text2

2020-07-11 07:47发布

Does anyone know if you can use (or convert) vim Syntax Highlight Definition Files with Sublime Text?

I am searching for a highlighter for promela and only found one for vim, but am using sublime-text as my default editor

The Definition i've found https://github.com/vim-scripts/promela.vim/blob/master/syntax/promela.vim

1条回答
萌系小妹纸
2楼-- · 2020-07-11 08:24

Sublime Text uses the XML-based PLIST .tmLanguage format for language definitions, and to my knowledge no one has written a converter for vim syntaxes. However, if you'd like to take a stab at creating one yourself, I'd recommend installing the PackageDev plugin for ST2 (it doesn't really work on ST3 yet). It allows you to define syntaxes using YAML, which is much easier to work with than XML, and the regexes are in Onigurama format. You can then use the YAML to PLIST converter to translate everything into a .tmLanguage format that Sublime will understand.

EDIT

PackageDev recently released a new version with full compatibility for ST3. It is available via Package Control.

查看更多
登录 后发表回答