Home Download Buy Blog Forum Support

ST2 - Add file type to syntax highlighting

ST2 - Add file type to syntax highlighting

Postby iamtyler on Tue Mar 29, 2011 6:57 pm

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?
iamtyler
 
Posts: 2
Joined: Tue Mar 29, 2011 6:51 pm

Re: ST2 - Add file type to syntax highlighting

Postby guillermooo on Tue Mar 29, 2011 7:09 pm

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

http://www.sublimetext.userecho.com/fee ... efinition/
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: ST2 - Add file type to syntax highlighting

Postby iamtyler on Tue Mar 29, 2011 7:34 pm

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.
iamtyler
 
Posts: 2
Joined: Tue Mar 29, 2011 6:51 pm

Re: ST2 - Add file type to syntax highlighting

Postby angelochen960 on Mon Mar 26, 2012 11:33 am

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
angelochen960
 
Posts: 1
Joined: Mon Mar 26, 2012 11:18 am

Re: ST2 - Add file type to syntax highlighting

Postby phillip.koebbe on Mon Mar 26, 2012 1:20 pm

angelochen960 wrote: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


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] https://github.com/phillipkoebbe/DetectSyntax
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 32 guests