geanygeany-plugin

Geany: Can we open a website link from geany text editor?


I am a big fan of Geany text editor. I am using it to write Python, C and as a simple text editor.

My question is following:

Suppose I have opened a file example.txt and it contains:

https://www.youtube.com/  
www.youtube.com

Is there any way I can select this text code and open from any browser? Is there any plugin or any workaround that I can open the given link directly in a web browser (let's say firefox) from the Geany text editor?

My intitial attempt is like this:

Edit > Format > Send Selection to > Set Custom Commands > firefox
Edit > Preferences > Keybindings > Send to Custom Command 1 > primary 1

Then, I did following steps:

selected the text "https://www.youtube.com/"
then press ctrl 1
then, the text "https://www.youtube.com/" vanishes
and, empty firefox is opened

Note that, however, if I type firefox https://www.youtube.com & This opens youtube without any error.

My question is can we do something that if I select the text and ctrl 1 opens the same website.

Some related links are following:
https://askubuntu.com/questions/312677/how-to-set-custom-commands-in-geany?rq=1
http://www.geany.org/manual/#sending-text-through-custom-commands


Solution

  • You can do this with a context action. See https://www.geany.org/manual/#context-actions

    Preferences -> Tools -> Contextaction

    firefox %s

    opens the selected Text

    Right-click or define a keybinding for executing this context action.