Is it possible to have different colors for different panes? I use “Open folder” to open a project in a separate pane. It would be easier to switch to the project I want if I could distinguish between the panes by color.
Different color schemes for different panes?
ST 3.2 supports per project color schemes and per view color schemes.
use “Open folder” to open a project in a separate pane.
Not sure what that means as each project requires a dedicated window. MacOS can group several windows together using some kind of tab control to allow switching between them. If this is what you mean with “pane”, per project color schemes might help you.
per project
My Project.sublime-project
{
"settings": {
"color_scheme": "Monokai.sublime-color-scheme",
},
}
per view
There is currently no GUI to setup per view color_schemes, but it is possible by API-call in the console.
view.settings().set("color_scheme", "Monokai.sublime-color-scheme")
Don’t know about ways to assign certain color schemes to single groups though.
It seems to be working with true color schemes, but not with themes.
{
"folders":
[
{
"path": "."
}
],
"settings": {
// "theme": "Creamy.sublime-theme",
"color_scheme": "OLED.sublime-color-scheme",
},
}
The line with Creamy does nothing when I load the project. The line with OLED works. Why is that?
Each instance of the main editor control is able to work with its own color scheme. Project specific settings are applied to each view. The full hierarchie is documented at https://www.sublimetext.com/docs/3/settings.html > SETTINGS FILES.
A theme on the other hand defines the look and feel of the application (all the parents of the the editor control).
Sublime Text’s theme engine supports only one theme per application at the moment. Hence the "theme"
key is ignored in project-specific/syntax-specific/view-specific settings.
OK, that makes sense. But I don’t understand why is Creamy then listed as a color scheme in my preferences?
Themes and color schemes are different things.
sublime-theme
files style the application as a whole (shape of tabs, font size use in them, etc). Since they style the whole application, you can’t set them per-file or per-window.
On the other hand, sublime-color-scheme
files are specifically for changing the color of the contents of a file (syntax highlighting). The legacy file format for this is unfortunately named tmTheme
, even though it’s a color scheme. Color schemes can be set per file or per window as desired,
When theme authors come up with a new theme for Sublime, they generally also create a color scheme that’s intended to be used with it to make the whole experience more cohesive. As such, it’s entirely possible (and fairly common) for a color scheme and a theme to be named the same, but there’s nothing that says you have to use one if you use the other.
If I may persist in my inquiry: how do I refer to the color scheme then? I can see Creamy listed as a color scheme:
But I cannot say
I get an error dialogue
On the other hand, I can certainly use the Creamy color scheme when I select it from the above menu.
How does all of this fits together?
Part of your problem is, as mentioned above, a sublime-theme
file and a sublime-color-scheme
file are different things; all else being equal, telling Sublime to load a sublime-theme
where it’s expecting a sublime-color-scheme
file is generally going to end in Sublime telling you that it doesn’t understand the format of the file.
If you’re unsure of what the proper value of the color_scheme
setting in your project should be, the easiest thing to do would be:
- Open your user preferences and make a note of what
color_scheme
is set to - Use the color scheme selector to pick the color scheme you want to use, which will update your preferences
- Copy the
color_scheme
setting over to your project and then restore the value from #1 back into your user preferences
Nice. That worked. Thanks!
BTW: I really do appreciate all the help you guys give the users of ST. I love this software. It makes it possible to be productive in ways I haven’t experienced before.