我可以从终端打开带有geany的文件吗?

问题描述 投票:1回答:2

我知道有一个快捷方式可以打开一个带有来自终端的崇高文本的文件,但是有一些类似于geany的内容,我可以在网上找到的唯一信息就是打开从geany到终端的文件。

terminal geany
2个回答
1
投票

你可以使用open

open [PATH_TO_FILE] -a [PATH_TO_GEANY_APP]

a选项定义要使用的应用程序。

To make this shorter, create an alias:

echo 'alias geany="open $1 -a [PATH_TO_GEANY_APP]"' >> ~/.bash_profile && chmod u+x ~/.bash_profile之类的东西。然后打开一个新的终端窗口并输入geany [path_to_file]


0
投票

如果Geany在您的路径中,请拨打geany <file>。这应该适用于Geany正在运行的每个平台。

在Geany的手册页中:

SYNOPSIS
       geany [option]  [+number]  [files ...]

这将在新会话中打开文件,或者如果已经运行Geany会话,则在现有会话中打开文件。

文件可以以空格分隔列表的形式给出,并且可能采用偶数行号:

files ...
 A space-separated list of filenames.  Absolute  and  relative
 filenames  can be used. Geany also recognises line and column
 information when appended to the filename with  colons,  e.g.
 "geany foo.bar:10:5" will open the file foo.bar and place the
 cursor in line 10 at column 5.
© www.soinside.com 2019 - 2024. All rights reserved.