Reputation: 93
Is there any way to inherit and existing Syntax for a custom one? As I would like to have a custom syntax but don't want to start from zero.
I already found this: How do I add features to a syntax definition in Sublime Text without editing it? but I couldn't get it to work as it is not detailed explained.
If this is not possible where would I find the file for the Go language syntax?
Upvotes: 3
Views: 1997
Reputation: 53799
You could copy the Go.tmLanguage
file, rename it to whatever you want, and then make whatever changes you want to it. You would still need to save that file in your Packages
folder.
To easily find the file, I recommend you install PackageResourceViewer through Package Control. Once you have that installed, do the following steps:
Type Ctrl+Shift+P to open up the command palette.
Type PackageResourceViewer: Open Resource
and press Enter
Type Go
and press Enter.
Using the arrow keys, go down to the file named Go.tmLanguage
and press Enter. This should open up the syntax highlighting file for the Go language.
Upvotes: 6