LoginSignup
26
28

More than 5 years have passed since last update.

ターミナルから、Atomを起動してみたら便利だった。

Last updated at Posted at 2016-04-29

普段、Macのターミナルで作業していて、ファイル操作をするときにviやvimでファイルを編集するときがあると思います!
でも、普段使っているテキストエディターと違って編集しづらすぎる。。
と感じたので、ターミナル上から指定したディレクトリファイルをAtomを起動する方法をやってみました!

方法

Atomを起動して、Atom->Install Shell Commandsatomapm をインストールします。

apmとは、atomのパッケージマネージャのコマンドのことです。

JtmFkq5uTNXn4fRH-9E3CB.png

インストール後、再度 Atom->Install Shell Commandsで、下記のポップアップが出ていればOKです!
(既にインストール済みの方は、初めからこちらが表示されると思います。)

スクリーンショット 2016-04-29 18.09.53.png

ここまで来れば、atomコマンドとapmコマンドが使えるようになっていると思います。

あとは、お好きなディレクトリで、
$ atom ./
とすれば、自動でAtomが起動し、ディレクトリファイルを開いてくれます。簡単!

[補足情報]内部的には、/usr/local/bin/atomに対して、~/Atom.app/Contents/Resources/app/atom.shがsymlinkとして貼られています。
/usr/local/bin/atom -> ~/Atom.app/Contents/Resources/app/atom.sh

26
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
28