23

For example, I often hit ctrl+w along with ctrl+s when I'm saving documents, causing them to save and then close. I can reopen them if I use the recent files list, but I am wondering if Notepad++ has an "open last closed document" shortcut, like ctrl+shift+t in firefox.

I was unable to find anything on Google.

Thanks!

3
  • Why not just get into the habit of saving with C-s?
    – Rook
    Nov 26, 2011 at 20:53
  • Just a tangent.. I think the default "open last closed document" shortcut in Firefox (at least for FF8 stable) is Ctrl + Shift + N, not T? Did you use Menu Editor to possibly change the shortcut binding? Nov 26, 2011 at 22:48
  • 1
    Ctrl+Shift+T is Undo Close Tab while Ctrl+Shift+N is Undo Close Window (see Keyboard shortcuts) Nov 27, 2011 at 7:40

6 Answers 6

11

Notepad++ now has this shortcut to restore a recently closed tab.
Control+Shift+T will restore the last recently closed file.

3
  • This interferes with the HTML Tag extension. If you wish to continue to use that extension's Ctrl + Shift + T command to highlight an entire html element, simply set Restore Recent Closed File to something else in the interface provided under Settings > Shortcut Mapper...
    – Keyslinger
    Nov 12, 2015 at 0:37
  • This is not working for me, I also don't have the option in my key bindings. My version is 6.5
    – MrFox
    Mar 17, 2016 at 13:26
  • 1
    @MrFox Update to a higher version. It's available since v6.8.
    – Arthas
    Aug 10, 2017 at 10:28
20

Its actually Alt+F, then hit number 1.

When you close a file, NP++ (for better or worse) sticks it at the top of the "recent files" list in the File menu.

That recent files list is actually a mind twist considering it only adds an entry to that list if you explicitly close it (so if you Save As, your file WILL NOT go to that list,) and it deletes an entry from that list as soon as you open the file (so you have to close it again to make it appear in the list).

3
  • 2
    I love you! I accidentally hit the bloody "Close All BUT This" options, instead of "Close" and it closed about 20 file (and I needed all of them). Well, I had to still re-order them into views, but that is okay. better than hunting them through the NppFTP list! Thanks! ♥ May 5, 2012 at 19:16
  • note that the shortcut depends on the language (portuguese would be Alt+A 1) Jun 4, 2013 at 14:48
  • This suggestion does not work if the file isn't loaded or saved though. At first it might be a bit far fetched to suggest the user has pressed ctrl-w and then dismissed the dialogue without reading it; but anyone who is the tech lead of the family can say that far fetched it is not.
    – LosManos
    Aug 9, 2016 at 12:31
2

No, there isn't. Not sure if it's doable with a plugin though, I'm alright with the recent files list.

1
  • Maybe it's time to write my own plugin, then! Thanks for the confirmation.
    – Erty
    Dec 14, 2010 at 22:48
1

You can anytime remap the keys.

EDIT: This will also help you see all the commands it supports.

5
  • Ah, but I like ctrl+w, since it's standard across applications. This shortcut (reopen last closed) would be handy in more than just my example instance. Still, that's a good idea: +1
    – Erty
    Dec 14, 2010 at 22:46
  • Reply to edit: I checked out the list of commands, but there was nothing close to what I was looking for. Ah well.
    – Erty
    Dec 14, 2010 at 22:51
  • @Erty: well.. by misclicking Ctrl+W you'll soon develop a reflex that will solve the problem. You just have to be patient and get angry each time it happens :)
    – ruslik
    Dec 14, 2010 at 22:54
  • 1
    It's something that reminds me of #define retrun return :)
    – ruslik
    Dec 14, 2010 at 22:56
  • Never heard of #define retrun return, but I think I may have to start using that. +1
    – Erty
    Dec 14, 2010 at 22:57
0

I don't believe it does; I haven't seen one while using it. However, I believe Geany does, and you may want to look into that editor. It doesn't support as many languages as Notepad++, but it has some more features that you might like, and I think it has this feature as well.

Edit: Yes, there's a mapping for "re-open last close tab" in Geany, so it seems to support that feature.

0

I have been googling all day to no avail, Notepad++ just can't do this on it's own. By chance I was playing with AutoIt today, and I built a tiny little standalone script that will send the alt+f & 1 keystrokes to open the most recent document. All you have to do it save it's path to the commands via the run menu, then assign it a shortcut key in the Modify Shortcut/Delete Command dialogue at the bottom of the Run menu.

Script is here: http://tylerthomas.me/Projects/Archive/Misc/NP++Reopen.exe

Source is here: http://tylerthomas.me/Projects/Archive/Misc/NP++Reopen.au3

Now my NP++ tabs work just like my chrome tabs! I can't post any more links but the above is explained in detail in the Notepad++ documentation on commands.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .