Sublime Forum

Two independent instances of ST running?


Can I get two independent instances of ST running? So that I can independently choose different themes for those editors?



Are themes/color-schemes supported in project files? I didn’t get it working just now, but if it did work, I imagine that would be easier to maintain.



It works with color schemes for me for projects. However, if I open a folder which does not have a project for some reason (there are some like this), it would be nice to be able to switch the theme on the fly without having to create a project and without changing the theme for all the open windows.



The theme setting classifies as an application behaviour setting and isn’t settable per-project.



Thank you. Does that mean I can’t have two instances of ST3 running at the same time with different themes in effect in those two?



Generally speaking, ST tries not to run two instances, but I’ve seen it done with different versions and might also be possible with one installed, and one portable.



The only way I know of to run two distinct instances is to run two different versions; If you try to run a second copy of the same version it just communicates its arguments to the running instance and quits.

This is a bit confusing; is there some benefit to having windows associated with projects have Default as the theme while windows without projects have the Adaptive theme (for example)?



Tested on Windows. You can have N portable STs, hence N ST instances without interfered with each other.



Oh, that is an excellent idea!



What I’m looking for is a way of having different “projects” (not necessarily ST projects) opened in clearly visually distinguishable windows so that switching between them gives me visual clues which is which.



For what it’s worth, it’s still possible to apply a color scheme to a window even if it doesn’t have a project associated with it, though you’d need a simple plugin to do so.

For example, if you open a new window you can use View > Show Console and enter the following to swap the color scheme in that window to Mariana:

window.set_project_data({'settings': {'color_scheme': 'Mariana.sublime-color-scheme'}})

That is; windows always have project data associated with them, even if there’s not a sublime-project file that’s storing it on disk.

A simple plugin could apply the appropriate setting in response to a key press, possibly toggling between multiple predefined color schemes.



I’m looking to do something similar to your solution here, Odat. I’d like to run two ST projects side by side, and I want one to be my customized monokai theme (which lives in my User directory), and I’d like the other to be a slightly tweaked version of that customized theme–to get some visual difference between the two (one is going to be my main writing project and the other is going to be used for notes and outlining.

I understand (roughly) how your solution here assigns a whole new theme for window 2, but how (where?) should I save and then invoke a tweaked version of my user/monokai theme for my second window?

I hope that makes sense.



The easiest thing to do to get something like this would be to use projects, so you can apply per-project settings. If you haven’t already done so, use Project > Save Project as... in the window you’d like to customize, to create a sublime-project file. Once you have a project, you can choose Project > Edit Project to open up the project file.

Projects are JSON files, and you can add a settings key to it and then add settings to it. An example of that might look like this:

			"path": "."
	"settings": {
		"color_scheme": "Monokai.sublime-color-scheme",

Any settings here will apply to any file that’s contained inside of the window that this project is open inside of. Any of the default preferences that are classified as Editor settings can be applied here, and they’ll override the defaults.

Below is a video that shows this in action and how to work with Projects and Workspaces if you’re unfamiliar. I also have a video on how the configuration system in Sublime works that covers the topic of settings and how they apply in general (which also shows an example like this and goes into more detail on what settings you can use here).

1 Like


Perfect, again. Thank you so much!