Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ shortcut.xml file getting wiped out after editing

I just did a fresh install of Notepad++. While Notepad++ was closed, I opened up shortcuts.xml from the C://Users/User/AppData/Roaming/Notepad++ folder (Windows7) and changed the following line:

<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox &quot;http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)&quot;</Command>

This change was suggested in an answer to another StackOverflow question: Configuring Notepad++ to run php on localhost?

When I opened Notepad++ after the change, there were no items in the "Run" dropdown menu, and shortcuts.xml was stripped to bare bones as follows:

<NotepadPlus>
    <InternalCommands />
    <Macros />
    <UserDefinedCommands />
    <PluginCommands />
    <ScintillaKeys />
</NotepadPlus>

The reason I did a fresh install was that I already ran into this problem. Although it might seem that it would be a simple matter to just copy and paste the original file, every time I restart Notepad++, the shortcuts.xml file gets wiped out. The only way that I have found to restore shortcuts.xml is by a fresh install, and it looks like there is no way to edit it without it getting wiped out.

I also tried editing the shortcuts.xml in the C://Program Files (x86)/Notepad++ folder. Although the XML file there didn't get wiped out, any changes made there seemed to be completely ignored by Notepad++. According to the the answer in the link I posted above, that is also the wrong file to edit.

I tried Googling the problem, but I didn't find anything.

UPDATE:

Without doing anything except for changing 'Firefox' to 'Mozilla,' it didn't wipe out the file, but as soon as I made the other changes to the line, it wiped it out again. Once it's wiped out, I haven't been able to restore it without a reinstall.

This seems to indicate that it depends on what edits are made. However, I've seen that other people have successfully launched PHP files in localhost from Notepad++, so it looks like this version is a little buggy in some respects.

like image 798
Expedito Avatar asked Dec 05 '25 02:12

Expedito


1 Answers

shortcut.xml is used by notepad++ while it's running. When you change the shortcut by settings->shortcut mapper, notepad++ will touch shortcut.xml. When notepad++ is closed it will restore keymap back to shortcut.xml. This looks like shortcut.xml was wiped out.

Therefore you CANNOT edit by notepad++ itself. You can use either way to manually modify shortcut.xml:

  1. Close notepad++ first, then edit shortcut.xml by other editor.
  2. Edit shortcut.xml in notepad++ but save to another name, then close notepad++. remove shortcut.xml then rename new saved file to shortcut.xml
like image 148
Jackie Yeh Avatar answered Dec 07 '25 19:12

Jackie Yeh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!