Sublime Forum

Override default associated syntax definition

#1

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”,
}
}

0 Likes

#2

Is is different from “View>Syntax>Open all with current extension as”?

0 Likes

#3

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.

0 Likes