5

I can open internet links in Notepad++ by double clicking on a link. Is there a way to do this only using keyboard? I mean are there any key board short cuts to achieve this?

2
  • do you mean href links, and when you open you say they open in browser. Not sure what you are asking. – defau1t Jul 12 '12 at 7:48
  • @refhat: exactly as you said – Robot Monk Jul 12 '12 at 8:23
1

Officially, no. At least in Notepad++ 6.1.2

In Settings > Preferences > Misc you have only "Enable Clickable Links" - not a word about keyboard.

In Settings > Shortcut Mapper > Main Menu, Run commands or Scintilla Commands there is no reference to this.

A macro cannot be recorded with this in order to assign a shortcut to this macro.

The "Launch in..." commands send the entire file to the chosen browser.

Of course, if you'll find a suitable plugin to do just that then you're lucky. Install it and assign a shortcut to it.

...but if you're quite extreme you can enable (on Windows) Mouse Keys and use the numeric pad as a mouse, hence you'll have the "left click" on the keyboard.

1

You can manually add to notepad++ a shortcut that launches the default browser with the selected text as a link.

Here is how to add the shortcut:

  1. Open Notepad++ shortcuts file: %appdata%\notepad++\shortcuts.xml
  2. At the end of <UserDefinedCommands> section, add:
    A shortcut with the keys Ctrl+Shift+Enter:
    <Command name="Open Link" Ctrl="yes" Alt="no" Shift="yes" Key="13">explorer &quot;$(CURRENT_WORD)&quot;</Command>
    
    Or a shortcut with no defined key binding:
    <Command name="Open Link" Ctrl="no" Alt="no" Shift="no" Key="0">explorer &quot;$(CURRENT_WORD)&quot;</Command>
    
    you can define the key binding in Notepad++ itself (Settings > Shortcut Mapper > Run commands).
  3. Restart notepad++.

Note: When the selected text is a local folder or file path, it will open the folder with file explorer or the file with the default program.

How it works: This solution works by calling windows file explorer with the selected text as an argument, so it is actually like opening file explorer and typing the link in the address bar.

This answer is based on the answer I found here: Launch in default Web browser, but I think its safer because it cant run any command, it just opens what file explorer knows how to open.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.