Josh Bjornson 5 years ago • updated by Jan Olsen 4 months ago 23
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)


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.

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.

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.



this is quite good. thank you, good sir.

consider submitting it to http://wbond.net/sublime_packages/package_control
I do command-shit-t in text editors without even thinking since I'm so used to this feature in my browser.  
Can't find my shit key... but agreed, i do the same. 
Man, I got all kinds of shit keys.  Best part of a computer, I swear.
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.
Or SublimeMRU which does a better job =p
Thanks, I would have never found that plugin. The name SublimeMRU tells me nothing about what it does.

Appreciate the vote down, BTW.


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.
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 :)

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).

This post was announced solved but I can't find what is the correct answer. (I know some idea above would be nice for some one BTW I wanna know which is the best.)
So what was added in 2165 and what is Ctrl-Shift-T command stand for? (command name?)
Cause I think I messed up the default key biding already for another plug-ins.
I used this keys for open project terminal.
Could you let me know clearly what's the command name?
{ "keys": ["ctrl+shift+t"], "command": "reopen_last_file" },