run problems:-
-
how do I now run code in a browser, there is no option to choose a browser now
-
View
>View Current File in...
-
Hello, @Terry-Shaw
Please follow these steps :
Step 1:- Open shortcuts.xml file.
Location :- (C:/Users/YourUserName/AppData/Roaming/Notepad++/shortcuts.xml)
Step 2:- Choosefile > open with
notepad++ menu.
Step 3:- Paste%AppData%\Notepad++\shortcuts.xml
into the file name input field and hit open to open your shortcuts.xml.
Step 4:- Paste/Insert one or more of the following lines in the black area, anywhere into your<UserDefinedCommands>
area:<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox "$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore "$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome "$(FULL_CURRENT_PATH)"</Command>
Step 5:- Save shortcuts.xml and restart notepad++.
Step 6:- Now open notepad++ and Go to the Run menu. in run menu shown launching option to add using above code.I hope above information will be useful for you.
Thank you. -
Hi,
thank you for your reply. I have done what you suggested only to find the code you suggested in already there.
So still have the problem.
Regards
Terry -
When diagnosing problems, it’s useful to provide information, such as Notepad++ version. This FAQ goes into more detail on that.
However, based on what you’ve said, you should see one or both of two things, depending on which version of Notepad++ you are using:
- If the Notepad++ is recent enough, there should be a View > View Current File In… menu entry (as @Alan-Kilborn said). This is the way to launch certain web-related files (.html, .js, .xml) in your browser. They will be grayed out for other files (like .txt, .asp, .php). (This issue and the Pull Request it links to will get rid of that restriction, and all file types will be able to be launched in the browser, if the PR is ever incorporated.)
- Your Run menu should have Launch in ___ entries, because of what you reported seeing in your
shortcuts.xml
.
However, since you see that
shortcuts.xml
has those entries, but you don’t see it in your Run menu, there are two likely scenarios that would cause this:-
you are looking at the wrong
shortcuts.xml
: if you have a normal installation, it will be in the location that @Prahlad-Makwana4145 described; however, if you have a portable installation, or if you disabled the%appdata%
-storage during install, then it will be in the same directory as yournotepad++.exe
executable. If you provide us with the ? > Debug Info, like the FAQ requests, it will tell us whichshortcuts.xml
you should look at. -
when looking at the
shortcuts.xml
file, there may have been<!--
and-->
surrounding the Launch in ___ entries; if so, those entries are commented out, and Notepad++ will not know that they are there.For example, all the versions I looked at (from v7.6.6 - v7.8.1) ship with
shortcuts.xml
containing:<!-- The following shortcuts are dangerous if your computer is compromised. (But if your computer is compromised, EVERYTHING IS DANGEROUS!) Remove the comment and use them at your own risk!!! <Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox "$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore "$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome "$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="65">safari "$(FULL_CURRENT_PATH)"</Command> <Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a "$(FULL_CURRENT_PATH)"</Command> -->
Because of the XML comment syntax, those entries will be disabled by default. If yours looks like that, just remove the
<!--
line, the lines of plain text, and the-->
line, leaving only the<Command ...>
lines from that section. (Don’t change anything before or after the comment-section.) Then save. Then exit Notepad++ completely. Then re-run Notepad++. It should now be in your Run menu.
Also, for future reference, this issue has been talked about multiple times in the forum. Here, or any other help forum, it is considered polite to search for an issue before asking your question. Just searching for “launch in chrome” in the forum search (using the traditional magnifying-glass search icon in the forum) had 9 of the first 10 results which would have answered your question directly.