Home Download Buy Blog Forum Support

Override default associated syntax definition

Override default associated syntax definition

Postby guillermooo on Sun Mar 20, 2011 9:51 pm

http://www.sublimetext.userecho.com/feedback/28863-/

Association between file types and syntax definitions is established in syntax definitions by means of the "filetypes" element. While normally this works fine, sometimes you might want to use an alternate syntax definition for a file type that already has a generic syntax definition associated with it, and to which Sublime gives precedence. To override the default syntax definition, it would be necessary to be able to specify a preferred syntax definition for a file type. If this preferred syntax definition wasn't found, Sublime would fall back to the current system.

Example:

file_types: {
"sublime-build": {
"syntax": "Packages/PackageDev/Support/Sublime Build.tmLanguage",
}
}
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Override default associated syntax definition

Postby adzenith on Sun Mar 20, 2011 10:36 pm

Is is different from "View>Syntax>Open all with current extension as"?
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: Override default associated syntax definition

Postby Anomareh on Mon Mar 21, 2011 2:48 am

That option works sometimes for me. Sometimes it doesn't though. For instance, I tried setting .bashrc to the Shell Script syntax via that option and it refuses to stick. Could be just a dotfile issue I suppose.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 12 guests