Home Download Buy Blog Forum Support

Opening sublime without reopening tabs from previous session

Opening sublime without reopening tabs from previous session

Postby sicromoft on Wed Dec 14, 2011 5:51 am

I've been able to mostly make sublime suitable for use from the Windows command line (setting it in the EDITOR environment var for tools like git) by using the undocumented --multiinstance flag (see viewtopic.php?f=3&t=2279). However, if there were tabs open the last sublime was closed, these tabs always get reloaded when sublime launches, which is annoying when you're just trying to edit a single file. Is there any way to prevent those tabs from reopening?

Maybe the -n command line flag should work that way? If sublime is already running, launching it again with -n opens a new empty window, so it would be consistent to do the same thing when it launches and it's not already running. Thanks...
sicromoft
 
Posts: 8
Joined: Sun Dec 11, 2011 11:23 pm

Re: Opening sublime without reopening tabs from previous session

Postby jps on Thu Dec 15, 2011 8:26 am

You can use the hot_exit and remember_open_files global settings for this
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Opening sublime without reopening tabs from previous session

Postby sicromoft on Fri Dec 16, 2011 6:49 pm

jps wrote:You can use the hot_exit and remember_open_files global settings for this


Thanks, yeah that kind of solves it. I think it would still to be nice to able to have remember_open_files set to true, but be able to open a "clean" sublime window via a command line switch (again, `-n` already does this, *except* when sublime isn't already running, which seems inconsistent). I think a lot of users like me like to use editors in two different contexts:

1) "project" context, where multiple tabs, hot exit, remembering open files, etc. are desired
2) "single file edit" context, where I want to edit a single file in isolation (usually launched from the command line) and I just want a single window with no other tabs and no hot exit.

Right now I can basically choose between one or the other with global settings, but it would be nice to be able to do both together, using a command line switch for #2. Seems like sublime is really close to supporting that, just not quite there.

Thanks for the great editor!
sicromoft
 
Posts: 8
Joined: Sun Dec 11, 2011 11:23 pm

Re: Opening sublime without reopening tabs from previous session

Postby sicromoft on Fri Dec 16, 2011 6:59 pm

Actually, I think all of what I described above could accomplished by using a dedicated project for the "single file edit" context, if only sublime would allow setting hot_exit and remember_open_files as per-project settings. Does that make sense? Any chance you could add that feature?
sicromoft
 
Posts: 8
Joined: Sun Dec 11, 2011 11:23 pm

Re: Opening sublime without reopening tabs from previous session

Postby gour on Tue Jan 31, 2012 9:00 am

sicromoft wrote:1) "project" context, where multiple tabs, hot exit, remembering open files, etc. are desired
2) "single file edit" context, where I want to edit a single file in isolation (usually launched from the command line) and I just want a single window with no other tabs and no hot exit.

Right now I can basically choose between one or the other with global settings, but it would be nice to be able to do both together, using a command line switch for #2. Seems like sublime is really close to supporting that, just not quite there.


+1

At the moment I use (g)vim as external editor for my Claws mailer and invoke it with:

Code: Select all
gvim "+set ft=mail" -f %s


where "%s" is replaced with the text of email message to be replied/composed.

So, if we're going to switch to ST2, we'd like to use it everywhere and have need to just launch it in "single file edit" context as described above.

I thought that using --new-window would make it, but, unfortunately, it doesn't.

Please, provide support for it and you have a new user. ;)


Sincerely,
Gour
gour
 
Posts: 8
Joined: Mon Jan 30, 2012 10:41 pm
Location: Croatia


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 34 guests