Does Notepad++ have an "unclose" command?

22

2

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!

Erty Seidohl

Posted 2010-12-14T22:41:25.650

Reputation: 597

Why not just get into the habit of saving with C-s? – Rook – 2011-11-26T20:53:01.163

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? – White Phoenix – 2011-11-26T22:48:49.113

1

Ctrl+Shift+T is Undo Close Tab while Ctrl+Shift+N is Undo Close Window (see Keyboard shortcuts)

– JustinStolle – 2011-11-27T07:40:52.180

Answers

11

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

Arthas

Posted 2010-12-14T22:41:25.650

Reputation: 146

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 – 2015-11-12T00:37:39.157

This is not working for me, I also don't have the option in my key bindings. My version is 6.5 – MrFox – 2016-03-17T13:26:45.920

@MrFox Update to a higher version. It's available since v6.8. – Arthas – 2017-08-10T10:28:14.020

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

bobobobo

Posted 2010-12-14T22:41:25.650

Reputation: 4 632

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 – 2016-08-09T12:31:47.860

2I 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! ♥ – omninonsense – 2012-05-05T19:16:58.917

note that the shortcut depends on the language (portuguese would be Alt+A 1) – Jonathan dos Santos – 2013-06-04T14:48:36.630

2

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

BoltClock

Posted 2010-12-14T22:41:25.650

Reputation: 753

Maybe it's time to write my own plugin, then! Thanks for the confirmation. – None – 2010-12-14T22:48:28.070

1

You can anytime remap the keys.

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

ruslik

Posted 2010-12-14T22:41:25.650

Reputation:

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 – None – 2010-12-14T22:46:17.897

Reply to edit: I checked out the list of commands, but there was nothing close to what I was looking for. Ah well. – None – 2010-12-14T22:51:07.570

@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 :) – None – 2010-12-14T22:54:31.097

1It's something that reminds me of #define retrun return :) – None – 2010-12-14T22:56:04.340

Never heard of #define retrun return, but I think I may have to start using that. +1 – None – 2010-12-14T22:57:35.560

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.

user541686

Posted 2010-12-14T22:41:25.650

Reputation: 21 330

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.

TylerT

Posted 2010-12-14T22:41:25.650

Reputation: 1

1

Also see http://sourceforge.net/projects/npppythonscript/ for another route to this behavior.

– TylerT – 2011-11-30T00:28:51.490