Home Download Buy Blog Forum Support

ST3: how to edit language packages

ST3: how to edit language packages

Postby Mambo4 on Fri Dec 06, 2013 7:06 pm

In ST2 I could browse the defualt packages for each language, open the -tmLanguage file for the language definitions and edit it.
(to add a new file extension to the Listed file types , for example)

in ST3 browse packages sends me to C:\Users\<user>\AppData\Roaming\Sublime Text 3\Packages
and I only see and edit teh few packages I have installed\
default packages appear to be compiled binaries in C:\Program Files\Sublime Text 3\Packages

SO, if I want to add a new file type extension to say my javaScript language definition, how do I do it?
Mambo4
 
Posts: 6
Joined: Sat Sep 08, 2012 5:53 pm

Re: ST3: how to edit language packages

Postby skuroda on Fri Dec 06, 2013 7:46 pm

I'd recommend using a plugin like ApplySyntax to set the syntax rather than modifying the file directly. You can also open a file wit the proper extension and use the "Open all with current extension..." menu. That being said, if you want to modify the syntax (or really any packaged plugin directly) and not worry about placing the files correctly, I would recommend using PackageResourceViewer. I wrote it to make browsing/overriding plugin files in ST3 easier.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: how to edit language packages

Postby Mambo4 on Sat Dec 07, 2013 2:07 am

I installed Applysyntax

the link says
Create your own rules in Packages/User/ApplySyntax.sublime-settings. The easiest way to get started is to just copy the default settings file found in Packages/ApplySyntax/ApplySyntax.sublime-settings to your user directory and modify it to meet your needs. Make sure you rename the default_syntaxes key to just syntaxes. If you don't, you will overwrite the default syntaxes and they will not work.


I have no Idea what a syntax rule looks like.
Packages/ApplySyntax/ApplySyntax.sublime-settings does not seem to exist so I cannot look at examples.

where are examples?
what do I type here?
Code: Select all
    // Put your custom syntax rules here:
    "syntaxes": [
       
    ]
Mambo4
 
Posts: 6
Joined: Sat Sep 08, 2012 5:53 pm

Re: ST3: how to edit language packages

Postby skuroda on Sat Dec 07, 2013 4:25 am

Take a look at the default settings file.

https://github.com/facelessuser/ApplySy ... e-settings
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am


Return to Technical Support

Who is online

Users browsing this forum: Alexa [Bot], Majestic-12 [Bot], Yahoo [Bot] and 33 guests