Use vim syntax definition with sublime-text2

走远了吗. 提交于 2019-12-06 01:31:17

问题


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:


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.



来源:https://stackoverflow.com/questions/20687815/use-vim-syntax-definition-with-sublime-text2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!