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?
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.
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.
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.
© 2022 - 2024 — McMap. All rights reserved.
select word
function ofline_tools.py
in this toolbox. Just editif not re.match("\w", char)
so it selects a url and get your browser to open it. – Angelicaangelico