I'm looking for a keyboard shortcut to quickly open links in a text file with a Web browser. Is there a trick or a plugin out there?
-
There probabliy isn't, but it's pretty easy to write your own plugin if you know python. You could for example start from the `select word` function of `line_tools.py` in [this toolbox](http://code.google.com/p/gedit-improving-plugins/). Just edit `if not re.match("\w", char)` so it selects a url and get your browser to open it. – Jens Nyman May 25 '12 at 18:49
3 Answers
You can do this with the External Tools Plugin that ships with Gedit. Select Tools
> Manage External Tools
. Create a new tool by clicking the little +
icon in the lower-left and name it "Open Link" (or whatever you want). Use the following code within the Edit
box (assuming you're using Firefox):
#!/bin/sh
xargs -I '{}' firefox '{}'
Then specify your shortcut key and make sure the Input
is set to Current word
. You can now open a link if the cursor is anywhere in the word (the URL) by choosing Tools
> External Tools
> Open Link
or using your keyboard shortcut.

- 9,967
- 3
- 31
- 43
I use Jean-Philippe's Open URI Context Menu plugin. It doesnt have a shortcut key but uses a simple right-click to open the link.
Just upgraded to Gedit 2.8 and version 2 of this plugin is way faster now.

- 469
- 6
- 6

- 3,148
- 5
- 23
- 28
Modern versions of gedit have the appropriate plugin built-in. Simply go to ☰ → Preferences → Plugins and enable "Open Links".
You can then right-click any link and a new context menu entry "Open Link" will be at the very top.

- 1,418
- 15
- 22