Sublime Forum

Project sessions plugin

#1

Wanted to share this simple plugin with those who wants it.
Saves me lots of frustration when switching between projects.

You can download and read more about what it does here: https://bitbucket.org/fuglesang/sublimetext-project-sessions/

A summary:

Hope people who wants this feature find it as useful as I do. :smile:

0 Likes

Virtual sessions
#2

NICE! That sounds like it will do just fine. Even something barebones like youā€™ve made is 100x better than nothing.

The only thing I see it missing is some way to open a temp session.

For instance, say you have a project open with a bunch of files and you get sidetracked. You need to work on a few other unrelated files, but you donā€™t care about the session. You donā€™t need it saved, it doesnā€™t have a project file, etc. It would be great if there was someway to open a temp session that closes and saves the current session / project and allows you to work on a clean slate. When youā€™re done, switching back to the original (or another) session would just close the files and not save the session and everything else.

Although itā€™s handy for switching between projects, I think my main desire for the feature was because I often need to edit a few files unrelated to the project and I just need a quick, temporary clean slate to work on.

Either way thanks a bunch for this. Iā€™ll play around with it a bit later.

0 Likes

#3

If you think of having no project open as a ā€œtempā€ session, you can already do what you want.

When you have a project open and then go to Project > Close project from the menu, the session for the project will be saved and you get your ā€œtempā€ session (no project, session doesnā€™t get saved). Once youā€™re done and want to go back to your project, you can open it and your project session will be restored (though you have to manually close your files from the temp session).

Iā€™m gonna add some configuration options for the open/close behavior so people can make it behave like they want.

When I get the time I was planing on making ā€œtaskā€ sessions as shown here: https://forum.sublimetext.com/t/group-files-as-task-sets/914/1

Iā€™m glad it came to use for you. Your post was actually what made me man up, learn python and fix this annoyance. :smiley:

0 Likes

#4

Ah good point. Been a bit since Iā€™ve actually gone into that menu I forgot.

0 Likes

#5

Very good idea!

But this plugin donā€™t work with projects opened as directory?

0 Likes

#6

No it doesnā€™t. I had actually forgotten that folders can act as projects in sublime. Iā€™ll take a look and see what I can do with that.

EDIT: I made a fast fix for this. Another small thing I didnā€™t think about is that you canā€™t have two projects with the same name (it will use the same session file). And here I thought this was gonna be a small project. :stuck_out_tongue:

0 Likes

#7

Hm, I try updated plugin, but this still donā€™t work as expected with directory projects :frowning:

0 Likes

#8

Bah, ok. Does it work for you when using .sublime-project files? Which operating system do you use?

0 Likes

#9

After implementing of ability to open directory as project I use only this type of projects. I didnā€™t try this plugin with .sublime-project files, sorry.
Windows 7 32bit.

0 Likes

#10

Updated the plugin.

Hopefully fixes the problem with directories as projects (works for me on winXP).
Added messages that displays in the status bar (on errors).
Made some behaviors customizable.
Fixed minor bugs.

0 Likes

#11

fuglesang,
Now itā€™s works for me! Itā€™s very useful, thanks!

But It has problem with session naming in some case :wink: For example, 95% of my directory (projects) has same name ā€œsiteā€. And this directory placed in directory with true name of the project. Like ā€œProject-1\siteā€, ā€œProject-2\siteā€, ā€œMySite\siteā€ etc. But session name has last folder name: ā€œsiteā€, ā€œsiteā€, ā€œsiteā€ etc :smile:

0 Likes

#12

Hehe, yes. I still have to change it up to support projects with the same name. Will probably get it done sometime this week.

0 Likes

#13

Hi fuglesang,

Just wanted to say that this is a fantastic plugin, resolving one of the few weaknesses in SublimeText. Thanks!

Cheers,

Josh

0 Likes

#14

Thank you for this plugin.
I knew I was missing it - but I didnā€™t knew how much. For me it is one of the essential plugins.

0 Likes

#15

Just want to report something:

Situation: You have your current window with all the view, then open a new window with no view, close the first window then the second.

Reopen Sublime will restore the second window only, loosing all the views existing in the first window.

I think Session should include all windows of a Sublime instance also.

0 Likes

#16

Small update: Made it so the session files are opened based on the path to the .sublime-project file or the directory opened as a project. This resolves the issue with having more projects (or directories) with the same name. Though now you canā€™t move your project around without having to remake the session. Also the old sessions are invalidated and have to me remade.

@jbjornson, tgkeul
Iā€™m glad you like it. ^^

@Esente
I tried to see if there was anyway I could implement support for this, but I canā€™t find anything that can help me. Doesnā€™t seem like this can happen automatically though I will see a bit more if I can come up with a solution. If you have any ideas on how this could be implemented, please tell. :smile:

0 Likes

#17

From the API, I think you can detect all opening windows from Sublime, so I think you could save that info into Session. Next time Sublime is loaded, there is command to open a new window. We could create tabs from that new window based on the info from the Session, no?

0 Likes

#18

not coding much latelyā€¦ but this is a great plugin!

0 Likes