Use vim syntax definition with sublime-text2

2.6k views Asked by At

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

2

There are 2 answers

0
MattDMo On BEST ANSWER

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.

0
Tom Hundt On

In case somebody else comes looking for one (it's now 2022 and we're on ST3 and ST4): There's vimscript-sublime which says it's deprecated and has a pointer to VimL, which is available by Package Control.

For some reason, none of these came up for me when I searched in Package Control for things like "vim script" or "vimscript" or "vim syntax". Now you know.