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

atom . (opens folder)

atom file.js (opens file)

atom (opens editor)

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


当前回答

一定要放(动)“Atom”放入Application目录。

其他回答

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

as

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

然后从终端调用

原子filename.whatever

符号链接解决方案停止为我在zsh今天工作。我最终在我的.zshrc文件中创建了一个别名:

alias atom='sh /Applications/ atom. app/Contents/Resources/app/atom.sh'

我也遇到了同样的问题,我通过移动原子侠解决了这个问题。app从下载到应用程序。然后在Atom的菜单选项下,我选择了“安装Shell命令”。

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

atom index.html 

html只是一个例子。

按名称打开应用程序:

open -a 'Atom' FILENAME