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 "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</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.
I successfully modified the configuration file, but it appears trying to do so directly even with a different editor is sometimes not possible. According to the documentation (http://npp-wiki.iwi.me/index.php/Configuration_File_Editing ), it was not meant to be done that way and can be tricky. For that reason, I can’t call it a bug, because it was simply not meant to be.
However, I accomplished the same thing through Notepad++ itself. Under the “Run” dropdown, the first item is “Run…” I clicked that, and in the text field I pasted:
And then I clicked “Save.” A new dialog box appeared to enter a name for the shortcut and key combinations. I entered “Launch in Mozilla” for the name. After clicking “OK,” it kind of gets Twilight-Zonish. It asks for another name, and after entering it and clicking “OK” it does the same thing… and so on… and so on… forever and ever… You can participate in this endless cycle as long as you wish, but I found that you can also simply close the dialog boxes, and everything works out fine.
In the end, my configuration file remained intact even after closing and opening again.
That’s the good news. The bad news is that the hack simply didn’t work for launching a PHP file in Firefox. In the browser the following appeared:
With a blank screen.
However that’s a totally different question.