我是Geany文本编辑器的忠实粉丝。我用它来编写Python,C和一个简单的文本编辑器。
我的问题如下:
假设我打开了一个文件example.txt,它包含:
https://www.youtube.com/
www.youtube.com
有什么方法可以选择这个文本代码并从任何浏览器打开?是否有任何插件或任何解决方法,我可以直接在Geany文本编辑器的Web浏览器(比如firefox)中打开给定的链接?
我最初的尝试是这样的:
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
您可以使用上下文操作执行此操作。见https://www.geany.org/manual/#context-actions
首选项 - >工具 - >上下文操作
firefox%s
打开所选文本
右键单击或定义用于执行此上下文操作的键绑定。
我确实关注了以下链接:假设链接是: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