Geany:我们可以从geany文本编辑器打开一个网站链接吗?

时间:2016-04-11 23:46:30

标签: geany geany-plugin

我是Geany文本编辑器的忠实粉丝。我用它来编写Python,C和一个简单的文本编辑器。

我的问题如下:

假设我已经打开了一个文件example.txt,它包含:

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

有什么方法可以选择这个文本代码并从任何浏览器打开? 是否有任何插件或任何解决方法,我可以直接在Web浏览器中打开给定的链接(让我们说firefox) 来自Geany文本编辑器?

我的初始尝试是这样的:

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

然后,我做了以下步骤:

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

但请注意,如果我输入firefox https://www.youtube.com & 这会打开youtube而不会出现任何错误。

我的问题是我们可以做一些事情,如果我选择文本并且ctrl 1打开同一个网站。

以下是一些相关链接:
 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 个答案:

答案 0 :(得分:1)

您可以通过上下文操作来执行此操作。参见https://www.geany.org/manual/#context-actions

  

首选项->工具->上下文操作

firefox%s

打开所选文本

右键单击或定义用于执行此上下文操作的键绑定。

答案 1 :(得分:0)

我确实关注了以下链接: 假设链接是:www.youtube.com

然后, firefox www.youtube.com 选择该行 右键单击,编辑>将选择发送到终端>点击进入

或者,我们可以为这些设置键绑定:

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

用法:

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

另一个例子:

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
相关问题