Sublime Forum

ST2 - Add file type to syntax highlighting

#1

In ST it was super easy to specify which syntax highlighting to use for a given buffer. It was also very simple to tell ST to always use a specific syntax highlighting scheme for all files with the current extension (all files of the current type).

For the life of me I can’t figure out how to do either of those things – especially the latter – in ST2. Specifically I’d like to add “ejs” as a file type for the HTML syntax highlighting scheme.

I’ve tried editing the HTML.tmLanguage file in the HTML folder in the Packages folder in AppData. I’ve tried zipping that up and placing it in the Pristine Packages folder within the ST2 installation. Is this not implemented yet or am I missing something?

0 Likes

#2

Maybe Jon’s reply to the following issue can help:

sublimetext.userecho.com/fee … efinition/

0 Likes

#3

Ah ha! Thanks for the link. I’ll have to check the ST userecho stuff in the future.

As a quick reference, View->Syntax contains the ST menus I described above.

0 Likes

#4

Hi,

Running ST2 build 2181 beta, how to set the ejs to use html setting? I already have a

HTML.sublime-settings:

{
“extensions”:

	"ejs"
]

}

some ejs file works, some not, why? thanks.

Angelo

0 Likes

#5

[quote=“angelochen960”]Hi,

Running ST2 build 2181 beta, how to set the ejs to use html setting? I already have a

HTML.sublime-settings:

{
“extensions”:

	"ejs"
]

}

some ejs file works, some not, why? thanks.

Angelo[/quote]

Hi Angelo,

While I don’t have an answer to your specific question, I can suggest to you that you give DetectSyntax[1] a try if nothing else works for you.

[1] github.com/phillipkoebbe/DetectSyntax

0 Likes