Hello, I was hoping I could have a few questions asnwered that hopefully will help me understand creating syntax definitions.
I started by following the docs for syntax definitions: http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html
which have you install PackageDev which I did.
Then later it says go to: Tools | Packages | Package Development | New Syntax Definition
But that doesn’t exist for me, so I['m not sure I’m on the right track.
I did go to: Tools > Developer > New Syntax
This opened a new file with what appears to be a YAML template.
It seemed to be similar to what they are using in the doc descriptions so a I saved it with user name with the .yaml extension in the file folder indicated by the docs:
…/AppDate/Roaming/Sublime Text 3/{ackages/User
Just to see if I was on track, as per the docs, I added the line ( it wasn’t there in the template ) just before the “scope:…” line, a line with “name:”
After “name:” I typed “vex” which is going to be the file extension name I am using for my new definition.
After the line with “name: vex” I added another line with “file_extensions: [vex]”
I saved the file and closed Sublime.
When I re-opened Sublime and opened a new file I went to View > Syntax but I don’t see the listed language “vex” which is what I assumed that the line in my yaml file would create as an option with “name: vex”
I guess what is happening is that in View > Syntax - under the YAML selection it will look at all the different yaml files you have and just automatically choose the definition based on lines that have "file_extensions: [your new file extension] in those yaml files.?
In other words its just your ‘job’ to remember if you have a yaml file that has a header and definition related to the unique file extension name you want it applie too? That you can’t just create a new selection in the " View > Syntax " menu?
Also, when I looked in the folder location for yaml file/s I noticed the other languages aren’t there like for c or python definitions.
I was hoping to find the c definition and simply copy and paste those definitions in my new vex - yaml file and simply make some minor changes. But I can’t find those ‘c’ definitions.
I guess those definitions are “built-in” Sublime? and that we access them through the “scope:” line of the yaml file. In my desired case - scope: source.c ? and then after that just add or make changes in that yaml file?
If anyone could give me some pointers so I understand this a bit better it’s much appreciated.
Thank you