Is it possible to reopen mistakenly closed file in Notepad++ using keyboard shortcut (Ctrl + Shift + T
). Most web browsers have this feature, if you close a tab by mistake.
Can we do that in NPP too?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityIs it possible to reopen mistakenly closed file in Notepad++ using keyboard shortcut (Ctrl + Shift + T
). Most web browsers have this feature, if you close a tab by mistake.
Can we do that in NPP too?
As a matter of fact, Ctrl+Shift+t
reopen last closed file in Notepad++ (version 7.6). But the file must be named (this shortcut do not work on new 1
and similar files).
If you do not have it setup already, you can have notepad++ "save" files automatically into notepad++ in case notepad++ gets closed or computer shuts down.
You will go to Settings -> Preferences -> Backup -> Enable session snapshot and periodic backup
At this point you will be able to close notepad++ and if you open it back up your files that you had open will still be there. You can also shutdown your computer and open notepad++ backup and your files that you had open will be there.
Also like what Romeo mentioned, you can press control + shift + t, and it will open your last txt document, but it will not work for unsaved txt documents.
After my comment earlier today, I found a bit of time and downloaded a portable v6.5 (from Sept 2013). It has that functionality, kind of, though under different names.
Once you close one or more tabs, the File menu will have a list of most-recently-closed files. You can click on the appropriate number, and it will re-open that file. So the keyboard sequence Alt F 1 (a sequence, not holding them down) will open the most-recently-closed. It's not quite as simple as Ctrl+Shift+T, but it's the same number of finger-presses. And just below that, Open All Recent Files will open all the recently-closed files. Unfortunately, neither of those has entries in the Shortcut Mapper... for v6.5.
I tried some experiments: I looked up the MessageID's from 7.6.2, which are Open All Recent Files (MessageID=42040) and Restore Recent Closed File (41021), and compared those to the codes in the 6.5 source code: I found Open All Recent Files was still 42040, but couldn't find an equivalent of Restore Recent Closed File. I tried adding a shortcut for both of those, or for just the 42040, by editing shortcuts.xml
in the <InternalCommands>
section, and exiting/reloading.... But NPPv6.5 didn't do anything when I tried those shortcuts, and when I exited and reloaded again, those shortcuts disappeared from shortcuts.xml
: so NPPv6.5 doesn't want shortcuts for even that known ID=42040.
So, the best I have to offer is to ask your Admin to install a newer version. As the best workaround I can find, use Alt F 1 in sequence.
Hope this helps.
ALT
+ Down Arrow
+ Number. This also seems to be an option, ALT
(with a fraction of sec pause) enables first menu, which is File
menu, and then I can pick any number to reopen that file. So, if I closed a file by mistake, I can simply do ALT
+ DownArrow
+ 1
. A good work around. Appreciate your investigation.
– NotepadPlusPlus PRO
Jan 31 '19 at 18:07