-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for project files to specify syntax specific settings for that project. #3815
Comments
Potentially related/solves: sublimehq/Packages#1764 |
Because the current syntax-specific overrides are based on the syntax implementation file, and not the base scope, it makes more sense to me if this were a map of (virtual) paths to syntaxes: // path/to/my.sublime-project
{
"syntax": {
"Packages/Python/Python.sublime-syntax": {
// Define any settings for python files that will override global
// syntax specific settings for Python.
},
"Packages/Javascript/JavaScript.sublime-syntax": {
// Define any settings for javascript files that will override global
// syntax specific settings for JavaScript.
}
}
} While we're on this subject, I'd like to mention that there is also a need for folder-specific overrides: // path/to/my.sublime-project
{
"folders": [
{
"path": "/home/user/workspace/foo",
"settings": {
// Define any settings for this `bar` folder that will override
// the project-specific settings
}
},
{
"path": "/home/user/workspace/bar",
"settings": {
// Define any settings for this `foo` folder that will override
// the project-specific settings
}
}
],
"syntax": {
"Packages/Python/Python.sublime-syntax": {
// Define any settings for python files that will override global
// syntax specific settings for Python.
},
"Packages/Javascript/JavaScript.sublime-syntax": {
// Define any settings for javascript files that will override global
// syntax specific settings for JavaScript.
}
},
"settings": {
// the project-specific settings that apply to all folders in the project
}
} Override chain would then be:
|
Folder specific settings overrides may potentially also solve this #207 |
related: #3932 |
Another solution(but a bit more radical) could be introducing the So, for example, This would also allow specifying project-related commands and (maybe)override some stuff since this folder would behave the same way the Theoretically, it could be even placed into all project folders to support folder-specific overrides |
Problem description
Currently, it is not possible for applying a specific setting to a file (syntax setting) only within a project.
Preferred solution
Allow for syntax specific settings within projects that will apply that setting to all the specific files only in that project.
A possible solution would be to introduce a new
syntax
key for project files as follows.Alternatives
One way I could think of would to use
on_load_project
or the async variant and listen for when a specific project changes and then apply the settings and clear them when the project switches, but IMHO, the above solution presents a much cleaner way of doing things.What is your use case for this feature.
Let's say I have a Flask application as a project and I want to switch the
.html
syntax toJinja2
. I have to do this globally. If I work on an Express project that may useHandlerbars
orNunjucks
, I have to again switch syntaxes.If the above feature could be implemented, I could just specify one templating syntax for
.html
in one project and it would stay HTML for all other projects except for that project.Additional Information (optional)
The text was updated successfully, but these errors were encountered: