How to open a link in browser from gedit?

This can be done with the nice gedit plugin open-uri-context-menu. I have tested this plugin on the three supported LTS releases:

  1. Xenial Xerus LTS (gedit 3.18.3)
  2. Trusty Tahr LTS (gedit 3.10.4)
  3. Precise Pangolin LTS (gedit 3.4.1)

Installation instructions are slightly different for each LTS release as a different version of the plugin is required for each. Select the appropriate version for your setup from the three given below:

1. Installation: Xenial Xerus

Xenial ships with gedit 3.18.3 and to install Version 3 of the plugin download and install as follows:

mkdir ~/Desktop/open_uri && cd ~/Desktop/open_uri
wget https://github.com/jpfleury/open-uri-context-menu/archive/master.zip
mkdir -pv ~/.local/share/gedit/plugins/
unzip -j master.zip 'open-uri-context-menu-master/open-uri*' -d ~/.local/share/gedit/plugins/

2. Installation: Trusty Tahr

Trusty ships with gedit 3.10.4 and to install Version 2 of the plugin download and install as follows:

mkdir ~/Desktop/open_uri && cd ~/Desktop/open_uri
wget https://github.com/jpfleury/open-uri-context-menu/archive/v2.zip
mkdir -pv ~/.local/share/gedit/plugins/
unzip -j v2.zip 'open-uri-context-menu-2/open-uri*' -d ~/.local/share/gedit/plugins/

3. Installation: Precise Pangolin

Precise ships with gedit 3.4.1 and to install Version 1 of the plugin download and install as follows:

mkdir ~/Desktop/open_uri && cd ~/Desktop/open_uri
wget https://github.com/jpfleury/open-uri-context-menu/archive/v1.zip
mkdir -pv ~/.local/share/gedit/plugins/
unzip -j v1.zip 'open-uri-context-menu-1/open-uri*' -d ~/.local/share/gedit/plugins/

4. Setup for Xenial, Trusty and Precise:

Then on any of the LTS releases open gedit and navigate to the 'Plugins' screen by following this trail:

 Edit > Preferences > Plugins

and then activate the plugin by ensuring there is a 'tick' or 'check' mark next to the plugin description as seen in the screenshot below:

enter image description here

Now when you right click on a link (admittedly not left click as you specified) within a document opened with gedit you will see the following options:

enter image description here

The two plugin options seen here are:

  1. Browse to: Open the link in an external browser such as Firefox
  2. Open: Open the contents of the link within another gedit window

Works nicely on each of my Xenial, Trusty and Precise systems and should on yours as well...

References:

  • jpfleury/open-uri-context-menu