Sublime Forum

Running instances with different settings / profile / binary

#1

Hi

I was wondering if there was a way to run two different instances sublime text 3 on osx. On windows I did this using portable installation but it is not available on mac. I tried solving this using the beta version, but it uses the same data folder with the stable one, so no luck there. (It would also be nice to isolate beta to prevent possible bug to do damage in stable profile folder).

I would like to have one configured as a “normal” text editor and another with various code buffers (multiple languages). It would be nice if code-version of the editor could be configured by default to have ligature enabled font and maybe even different plugin set than the default version.

Project settings are not sufficient here, because I often handle small, snippet like short functions and have no need for file for then.

1 Like

#2

I’m not sure from your description why you require separate distinctly separated versions for coding and “normal” text since presumably packages not for coding aren’t going to mess with plain text files at all.

Regardless, the thing that makes the portable version of Sublime on Windows work is the presence of a folder named Data sitting in the same folder as the binary.

It’s not documented anywhere (and thus likely unsupported, subject to change at any time with no notice, may cause the bags under your eyes to get so big that your head falls into them, etc etc) but creating a similarly named folder alongside the Sublime binary on Linux or MacOS has the same effect.

In the case of MacOS, that means as long as you have another copy of the Sublime Text.app folder sitting somewhere, you can go inside it’s Contents/MacOS folder and create a folder named Data, which will cause that copy of Sublime to use that data folder instead of the one in your home directory.

On Linux you’d do that by pulling down a copy of the tarball version and making the folder in there (the case of the Data folder is important or it won’t be recognized).

4 Likes

#3

Thats awesome, thanks :).

Biggest reason for different setups for me is the different default font and separating beta from stable version.

0 Likes

#4

Sorry, I can only give you PART of answer (the Mac part, not the Sublime part):

open -b com.sublimetext.3 -n --args -w -n ~/ds/README.txt
open -a "/Applications/Sublime Text.app" -n -W ~/ds/README.txt

open on the Mac is like start on windows (or xdg-open on Linux)
-n starts a NEW instance of the app, even if one is already running
`-W makes the open command block and wait until the app exits

Note that you can provide file argument in the open command-line (ex 2 above),
OR to Sublime’s main() by putting them after --args

open -F opens the app without restoring any previously opened windows
BUT Sublime doesn’t use the Mac OS facility for storing the application state of open windows. It uses it’s own saved-state file somewhere in

~/Library/"Application Support/Sublime Text"/...

So when the open -n starts the 2nd instance it opens all the same files & windows as the first one. :frowning:

See also:

/Applications/"Sublime Text.app/Contents/MacOS/Sublime Text"  -h

Sorry I couldn’t be more help

1 Like

#5

Thanks for your solution. Data-directory trick described by OdatNurd did what is was looking.

Syntax specific settings also come a long way, but the current stable version of ST3 does not support ligatures so I’d rather keep beta and stable configurations separate. Also I sometimes have way too many unsaved buffers so it is nice to separate them to different instances.

1 Like