Where are recorded macros stored in Notepad ++?

I recorded a macro that I want to share with my work colleague.

Where are these recorded macros stored so that I can add it to my computer?

If this is interesting, the macro takes a list of values ​​and adds quotation marks and a comma so that it can be used in the WHERE SQL query ( WHERE x IN ('value1','value2','value3') ).

+85
macros file notepad ++
Mar 25 '11 at 11:45
source share
8 answers

On Windows, macros are saved in %AppData%\Notepad++\shortcuts.xml (Windows logo key + E and copy and paste %AppData%\Notepad++\ )

Or:

  • On Windows <7 (including Win2008 / R2), macros are saved in C:\Documents and Settings\%username%\Application Data\Notepad++\shortcuts.xml
  • In Windows 7 | 8 C:\Users\%username%\AppData\Roaming\Notepad++\shortcuts.xml

Note. You will need to close Notepad ++ if you have new macros that you want to export.




Here is an example:

 <NotepadPlus> <InternalCommands /> <Macros> <Macro name="Trim Trailing and save" Ctrl="no" Alt="yes" Shift="yes" Key="83"> <Action type="2" message="0" wParam="42024" lParam="0" sParam="" /> <Action type="2" message="0" wParam="41006" lParam="0" sParam="" /> </Macro> <Macro name="abc" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="a" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="b" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" /> </Macro> </Macros> <UserDefinedCommands>.... 

I added the 'abc' macro as proof of concept.

+101
Mar 25 '11 at 12:44
source share

For macros, Windows 7 is stored in C:\Users\ Username \AppData\Roaming\Notepad++\shortcuts.xml .

+35
Jun 23 2018-11-11T00:
source share

In Vista with virtualization enabled, the file is located here. Note that the AppData folder is hidden. Either show hidden folders, or go directly to it by typing % AppData% in the address bar of Windows Explorer.

 C:\Users\[user]\AppData\Roaming\Notepad++\shortcuts.xml 
+4
Oct 29 '12 at 18:06
source share

Press F6

Insert ::

 npp_open $(PLUGINS_CONFIG_DIR)\..\..\shortcuts.xml 

Click OK

You now have a file open in your editor.




Before changing the contents, check the related documents .

+3
Oct 30 '12 at 15:24
source share

You can find the shortcuts.xml path in AppData\Roaming\Notepad++\ only when using the default settings. If you set up a backup, you can find and set the path in Preferences -> Backup -> Backup path .

Using these parameters, the files in the AppData directory will not be used.

+3
Dec 03 '14 at 18:10
source share

Notepad ++ will forget your macros if you do not match them with hotkeys through Settings - Shortcut mapper - macros before exiting Notepad ++ (according to https://superuser.com/questions/332481/how-can-i-add- a-macro-in-notepad . Tested with Notepad v6. 8.3 on Windows7.)

+1
Oct 05 '15 at 3:04
source share

If you install Notepad ++ on a Linux system because of a fault (in my case, the Ubuntu desktop 14.04-LTS_X64), the file "shortcuts.xml" is located under:

 $/home/[USER-NAME]/.wine/drive_c/users/[USER-NAME]/My Documents/.wine/drive_c/Program Files (x86)/Notepad++/shortcuts.xml 

Thanks to Harrison and everyone who has suggestions for this.

0
Sep 14 '14 at 7:28
source share

Go to the% appdata% \ Notepad ++ folder.

Macro definitions are stored in shortcuts.xml inside the <Macros> . You can copy the entire file or copy the tag and paste it into the shortcuts.xml file elsewhere.
In the latter case, be sure to use a different editor, since N ++ overwrites shortcuts.xml on exit.

0
Jan 18 '16 at 13:21
source share



All Articles