LoginSignup
97
75

More than 5 years have passed since last update.

Sublime Text3をコマンドラインから開くようにする

Last updated at Posted at 2014-10-18

Sublime Text3のパッケージ内にsublコマンドがおいてある。

/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
これにファイルを渡せばSublime Text3で開ける。
これを直接コマンドラインで叩くには

  1. ~/.bash_profile とか ~/.profile とかに alias を定義する
  2. パスの通っているところにシンボリックリンクを貼る
  3. パスの通っているところにコピーする

この記事では2でやってみる。

基本的に自分がインストールしたコマンドは/usr/local/binに置かれるので、それに倣う。

操作例
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
subl

でSublime Textが立ち上がれば成功。

sublコマンドのusageはここに書いてある。
OS X Command Line - Sublime Text 3 Documentation

(実はここにセットアップ法も書いてあったので公式ドキュメントはやはり大事ですね)

97
75
2

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
97
75