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

1.6k views Asked by At

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

2

There are 2 answers

0
user11434818 On BEST ANSWER

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.

0
BhishanPoudel On

I did following to open a link: suppose the link is : www.youtube.com

then, firefox www.youtube.com select the line right click, Edit > send selection to terminal > hit enter

Or, we can set keybindings for these:

Edit > Preferences > keybindings
Select Current Line(s) = shift alt L
Send selection to terminal = shift alt T

Usage:

firefox www.youtube.com
select this line: shift alt L
send to terminal: shift alt T
go to terminal  : F4
run command     : Enter

Another Example:

www.youtube.com
select this line: shift alt L
send to terminal: shift alt T
go to terminal  : F4
go to beginning : ctrl A
add a command   : firefox 
run command     : Enter