Home Download Buy Blog Forum Support

ST2: Help creating a new syntax definition

ST2: Help creating a new syntax definition

Postby digiduck on Mon Aug 08, 2011 7:23 pm

I noticed there isn't a New Syntax menu option like there is for snippets, build systems, etc. Is there any documentation around creating new syntax files for ST2?

The documentation at http://sublimetext.info/docs/en/extensibility/syntaxdefs.html appears to only apply to ST1.

Is there a Sublime JSON format for syntax files or is the only method to just create a TM language file directly?
digiduck
 
Posts: 19
Joined: Mon Aug 08, 2011 1:27 pm

Re: ST2: Help creating a new syntax definition

Postby adzenith on Mon Aug 08, 2011 9:30 pm

Ultimately the file must be XML. That plugin you linked to will convert a JSON file to XML, so it may be nicer to use, but I haven't tried it out.
In general, because ST2 can use TextMate grammars, if you're using some language that other people have used you can usually just use a TM grammar that someone has already made instead of rolling your own.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: ST2: Help creating a new syntax definition

Postby aparajita on Tue Aug 09, 2011 6:04 am

digiduck wrote:I noticed there isn't a New Syntax menu option like there is for snippets, build systems, etc. Is there any documentation around creating new syntax files for ST2?

Is there a Sublime JSON format for syntax files or is the only method to just create a TM language file directly?


You can write syntax files directly using XML. TextMate uses plist format in its editor, but on disk the files are actually XML. Once you get used to it, it isn't that hard to work directly with the XML.
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 18 guests