SirWill
SirWill

Reputation: 93

Edit Existing Syntax Highlighting in Sublime Text 3

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

Answers (1)

Saad
Saad

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:

  1. Type Ctrl+Shift+P to open up the command palette.

  2. Type PackageResourceViewer: Open Resource and press Enter

  3. Type Go and press Enter.

  4. 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

Related Questions