Adding support for a Default.sublime-color-scheme
would solve many plugin color scheme issues.
One of the issues with plugins and color schemes is that plugins sometimes need to add default basic styles for the plugin features to work out-of-the-box.
For example, SublimeLinter (SL) configures a plain red color for linting errors by generating a new color scheme based on the original, with the default styles injected into it. It only does this if the color scheme doesn’t already support SL.
Ideally:
- Plugins could add default styles so that it works out-of-the-box.
- Color schemes could progressively enhance support for plugins.
Having a Default.sublime-color-scheme
merged before the selected color scheme file is loaded, could potential solve some of the issues above. It’s easiest to illustrate by example (the scopes names I’m using are unimportant for the example):
Packages/GitGutter/Default.sublime-color-scheme
{
"rules":
[
{
"scope": "gitgutter.added",
"foreground": "green"
}
]
}
Packages/SublimeLinter/Default.sublime-color-scheme
{
"rules":
[
{
"scope": "sublimelinter.error",
"foreground": "red"
}
]
}
Whatever color scheme is selected now has default styles for both GitGutter and SublimeLinter.
Let’s suppose the color scheme “Marvin” wants to enhance support for the plugins:
Packages/Marvin/Marvin.sublime-color-scheme
{
"rules":
[
{
"scope": "gitgutter.added",
"foreground": "lightgreen"
},
{
"scope": "sublimelinter.error",
"foreground": "lightred"
}
]
}
This will mean plugins can provide defaults and colors schemes can enhance support.