Search code examples
sublimetext2

SublimeText 2 - Save/Restore Session


I am new to using sublime text and find it great. I am using Sublime in Ubuntu 12.04 and am missing some features.

In SublimeText if I open a Window and close it through the menu, next time I open SublimText, the Window with the open documents will be available. Great but not very useful, because I work with many projects simultaneously.I currently keep all of them open in many windows, but is a pain to do so.

I would like to store session information on a per folder/prject basis. So, when I open Sublime through the terminal, the session will be available

For example

$ cd /path/to/project
$ sublime-text .
# if a session is saved (project opened before), opens the Sublime with the last saved session for the folder/project

It will be great to know if it is possible. After days of searching, I have grown tired of it.


Solution

  • You can open a project from the command line by passing the .sublime-project file as an argument. Within your project, you can put custom settings like "remember_open_files": true, but set it to false in your Packages/User/Preferences.sublime-settings file.