我有Atom编辑器,想知道如何从Atom中的终端打开文件或文件夹。我正在使用Mac。我正在寻找一种方法来做到这一点:

atom . (opens folder)

atom file.js (opens file)

atom (opens editor)

这是可能的吗?我如何设置它?


当前回答

对于默认Atom安装的Windows 7 x64,将此添加到您的PATH中

%USERPROFILE%\AppData\Local\atom\app-1.4.0\resources\cli

并重新启动任何正在运行的控制台

(如果你在那里没有找到Atom -右键单击Atom图标并导航到目标)

其他回答

按名称打开应用程序:

open -a 'Atom' FILENAME

在shell配置文件中添加路径(:/usr/local/bin/)。

Mac:文件$home/.bash_profile

export PATH=$GOPATH/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:$PATH

转到您的终端并找到您的目录。执行如下命令:

atom index.html 

html只是一个例子。

除了sbedulin的回答(问候,可爱的Windows用户!)

Windows上的一般路径应该是

%USERPROFILE%\AppData\Local\atom\bin

如果您使用的是像Babun这样的Bash模拟器,最好签出shell文件,这些文件只能在真正的应用程序文件夹中使用。

/c/User/<username>/AppData/Local/atom/app-<version>/resources/cli/apm.sh # Or atom.sh

在macOS上,您可以将其添加到~/.bash_profile中

as

别名 atom='open -a 'Atom''

然后从终端调用

原子filename.whatever