Notepad++ Shortcut – How to Reopen Closed Tab

keyboard shortcutsmacrosnotepadtabs

To reopen a closed tab in Notepad++ you press ALT+F&1. I was wondering if there was a way to make a macro or program to do this so that I can press link it to the shortcut CTRL+SHIFT+T instead, which is a universal reopen closed tab shortcut I'm used to.

If anyone could tell me how to make a simple program that does that, and that I could then link to Notepad++ to create a shortcut with, that would teach me a lot and help.

Thank you for reading

Best Answer

I have successfully tested the following solution: define this AutoHotKey macro:

SendMode Input                ;just to set up preferred method of sending hotkeys
SetTitleMatchMode, RegEx      ;from now on, windows titles are matched by regex

#IfWinActive Notepad\+\+      ;(open block) the following hotkeys work only in N++
+^t::Send !f1                 ;desired hotkey: Ctrl+Shift+T sends Alt+F, 1
^w::Send ^{F4}                ;bonus: Ctrl+W sends Ctrl+F4 (close file convention)
#IfWinActive                  ;(close #IfWinActive block)

do not forget to run AutoHotKey as administrator.

Using the AHK you can achieve many useful things in N++ and all other applications.