Can gedit open links in a Web browser by clicking on it?
Asked Answered
A

3

6

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?

Accommodative answered 13/5, 2012 at 14:39 Comment(1)
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. Just edit if not re.match("\w", char) so it selects a url and get your browser to open it.Angelicaangelico
G
3

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.

Gossamer answered 7/7, 2012 at 15:0 Comment(0)
P
3

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.

Pipestone answered 26/5, 2013 at 15:20 Comment(0)
B
0

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.

screenshot highlighting the described plugin in the list

Benison answered 12/5, 2022 at 16:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.