kousha
kousha

Reputation: 782

Sublime Text 2 / Sublime Text 3 bring back unsaved files on osx

In sublime I know even if you don't save the changes in a file later one you can start from where you left off. I opened a new tab in sublime and closed the application before I save my file. Does sublime save a temp file somewhere in the computer (I am using MAC OSx)

Upvotes: 33

Views: 35310

Answers (5)

mcw
mcw

Reputation: 3596

Sublime Text 2 stores the files in ~/Library/Application Support/Sublime Text 2/Settings, in the .sublime_session files that are located there:

The contents of those files are a large JSON blob that contains the individual tab contents. Search in the file for the file name / tab name / a key word in the document and you should be able to get what you need.


For Sublime Text 3, use the following path:

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

Credit to: eebbesen


For Sublime Text 4, use the following path:

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

Upvotes: 71

sathyamus
sathyamus

Reputation: 21

For Sublime Text 3 / For Sublime Text 4

If you used portable version(.zip) version then refer to sublime_installation_folder\Data\Local\Session.sublime_session

PS: Make a backup, before replacing the file, in case, you want to revert

This gives you your unsaved files and opened files as per your recent view.

Upvotes: 2

Sugyan sahu
Sugyan sahu

Reputation: 159

For Sublime Text 3,

Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session

Upvotes: 3

joker
joker

Reputation: 3742

I know it's a late answer but here's where I found it.

Linux: ~/.config/sublime-text-3/Local/Session.sublime_session

Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session

Hope this helps someone someday.

Upvotes: 14

idleberg
idleberg

Reputation: 12882

As far as I know, Sublime Text keeps open files when you quit the application. However, if you close the tabs or project window without saving, the changes are lost.

In the former case, the files are saved in Local/Session.sublime-session (I'm using ST3 though, could be different in ST2!) You can open ST's packages folder from the command palette using "Browse Packages".

Upvotes: 6

Related Questions