Sublime Forum

Save and Reopen Untitled Tabs

#1

See the replies in this thread before using.

Another day another plugin: gist.github.com/1028532

The inspiration for this one comes from E. In E, I could open a tab, jot some notes down and never save the tab. If I closed the editor and opened it again, E would also that tab I never saved. It was awesome and I missed that feature in sublime.

So, this plugin periodically saves any tab that has never been saved to the filesystem, to the Packages/User/UntitledFiles directory. When you reopen sublime, it opens a new tab for each of them and fills in the content.

0 Likes

API Requests
#2

Sublime Text will do this out of the box is if you use “File/Hot Exit”, rather than exiting normally.

0 Likes

#3

O nice, I had no clue. Is it possible to make Hot Exit the default behavior (so that hitting the Red close button does a Hot Exit)?
Also, one slight difference is if sublime crashes or is forcibly closed, I lose the unsaved files. With the plugin it saves them somewhat quickly after modifying them.

0 Likes

#4

New files, as well as unsaved changes to existing files, will be periodically saved in the autosave session and restored at startup if the application wasn’t exited cleanly. The autosave interval is 30 seconds. Also, when switching projects, your unsaved files and changes will be recorded in the project, so you can have scratch files per project.

I’d like to make hot exit the default, but the semantics don’t appear clear on windows and linux where the application is exited by closing the last window. Doing a hot exit when closing the last window would imply that you’d get a ‘Do you want to save…’ prompt when closing a window other than the last one, but no such prompt when closing the last window.

I’m not entirely happy with the disconnect, but given the number of requests to have hot exit be the default, it may be worthwhile doing anyway.

0 Likes

#5

If the discussion is about files and other editors, there is any way of doing the undo steps to work beyond file close? I mean if I reopen a file, I would like to be able to undo any changes i did before, for last… let’s say X days.

Thanks!

This is one of the feature I miss most. The other one is undo tree. :smiley:

0 Likes

#6

Well, you don’t necessarily have to make it the default, maybe just expose a setting so that individual people can make it their default.

I swear I tried testing if sublime autosaves changes, I guess I didn’t wait long enough. O well. If I could just make HotExit the default, it would completely eliminate the need for this plugin. I’m not overly worried about the thing you brought up, I rarely open more than one window.

0 Likes