Where does Sublime Text store its un-saved windows

sublime-text-3

I'm using Sublime Text as a notepad and usually I've plenty of un-saved files which usually are re-open after reboot or crash, but I'm afraid to lose them (which happened few times).

Where (in which folder/file) does Sublime Text store these temporary files, so I can do some periodic session backups?

Best Answer

Where does Sublime Text store its un-saved windows?

This depends on which operating system your are using.


OSX

Sublime Text 3:

~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session

Sublime Text 2:

~/Library/Application Support/Sublime Text 2/Settings/Auto Save.sublime_session

I'm wondering if there is a location Sublime puts temporary files? I just lost a WP theme I was working on due to MacOSX blundering, wondering if I can get any of the files I was working on back from Sublime temp files.

...

Sublime Text will save auto save information to ~/Library/Application Support/Sublime Text 2/Settings/Auto Save.sublime_session, but it does so on a regular basis, and the chances are it's overwritten by now, unfortunately.

Source Temporary Files location?


Windows

For the settings folder you could look for a unique file using:

F:\>dir license.sublime_license /s /b  

For XP that would return:

F:\Documents and Settings\user\Application Data\Sublime Text 2\Settings\License.sublime_license

Alternatively:

  • Open sublime and go to preferences > browse packages.
  • Then to the parent directory and you'll see the settings subdirectory.

XP

C:\Documents and Settings\user\Application Data\Sublime Text 2\Settings\Auto Save Session.sublime_session

Windows 7

Sublime Text 2:

C:\Users\user\AppData\Roaming\Sublime Text 2\Settings

Sublime Text 3:

C:\Users\user\AppData\Roaming\Sublime Text 3\Local

(section added by barlop)

Related Question