+130
COMPLETED
posted by Josh Bjornson , updated 1 year ago , 20
Just like in Firefox (ctrl+shift+t), it would be nice if you could re-open the file (tab) you just closed. There is a plugin for Sublime Text 1 that does this, but maybe this should be part of the core? (since the core should know best about what files were closed recently)
Vote

Answer

ANSWER
COMPLETED
This was added in 2165
Yeah, this one would be nice.
Until its added you can use a small plugin I've written just to checkout the api.

+7
Additionally, if you only care about reopening an accidentally-closed tab I found this somewhere on the forum or the wider Internet. Just stick it in your user keybindings:

{ "keys": ["ctrl+shift+t"], "command": "open_recent_file", "args": {"index" : 0} }

I use it, but I've still +1ed this as I think it'd be a nice feature to have built in to the editor, with the ability to incrementally traverse the MRU.
This is great, although it's unfortunate that this solution only supports the most recent tab and no history beyond that.
+2

I created a plugin that keeps track of which files have been recently closed, as well as files that have been recently accessed.  The plugin can be used to simply open the last file you closed or can be used to display a quick panel with a list of recently accessed file (closed files first, followed by accessed files).

It stores this history in a settings file, so is persistent across sessions (Packages/User/FileHistory.sublime-settings).  It also keeps a global and per-project history allowing you to choose between the project-specific file history or the file history across all projects.

One issue is that you cannot find out what the current project is (using the API), so I had to use a hash of the open folders to identify the project.  Unfortunately, the side-effect of this is that when you add or remove a folder from a project, the project specific file history will be orphaned and the plugin will start a new history.

https://gist.github.com/1133602

+1

this is quite good. thank you, good sir.


consider submitting it to http://wbond.net/sublime_packages/package_control
+2
I do command-shit-t in text editors without even thinking since I'm so used to this feature in my browser.  
+6
Can't find my shit key... but agreed, i do the same. 
+3
Man, I got all kinds of shit keys.  Best part of a computer, I swear.
+4
Install "Open Recent Files" from Package Control to enable undo for multiple tabs. Works for up to 20 tabs, and even remembers your closed tabs between launches.
+5
Or SublimeMRU which does a better job =p
+2
Thanks, I would have never found that plugin. The name SublimeMRU tells me nothing about what it does.

Appreciate the vote down, BTW.
+2

http://www.google.com/search?q=mru

The second result shows that MRU stands for Most Recently Used; it's a fairly common acronym. Now that you know, you'll be recognizing it more in the future. :)


MRU is nicer for sure, especially the panel feature.

Still, the downvote is a bit unnecessary.
+1
Lol I was just messing around, I've long changed it back
Google shows different results for everyone. #7 for me for mru.vim plugin.


Anyway, my point was that looking through the Package Control list I wouldn't have thought to install "SublimeMRU", whereas "Open Recent Files" was immediately obvious. Plus, there are already way too many TLAs :)

ANSWER
COMPLETED
This was added in 2165

How do I use this? I'm using 3021

Should just be Ctrl-Shift-T (Windows, Linux) or Cmd-Shift-T (Mac).