LoginSignup
29
24

More than 5 years have passed since last update.

sublコマンドの感動を教えたい!mac版

Posted at

sublimeTextを愛してやまない君たちに伝えたいことがある。

ターミナル.appを開いて以下のコマンドを入力して下さい。

subl -h

 

以下のような内容が表示されればもう伝えることは何も無い。
早くここから立ち去るのだぁxaxaxa

Sublime Text 2 Build 2221

Usage: subl [arguments] [files]         edit the given files
   or: subl [arguments] [directories]   open the given directories
   or: subl [arguments] -               edit stdin

Arguments:
  --project <project>: Load the given project
  --command <command>: Run the given command
  -n or --new-window:  Open a new window
  -a or --add:         Add folders to the current window
  -w or --wait:        Wait for the files to be closed before returning
  -b or --background:  Don't activate the application
  -s or --stay:        Keep the application activated after closing the file
  -h or --help:        Show help (this message) and exit
  -v or --version:     Show version and exit

--wait is implied if reading from stdin. Use --stay to not switch back
to the terminal when a file is closed (only relevant if waiting for a file).

Filenames may be given a :line or :line:column suffix to open at a specific
location.

さて、ではsublのコマンドをインストールする。
以下の魔法の言葉をターミナルにコピペするべし。

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl

パスワードを聞かれたら入力!

さてこれで

subl -h

を実行したらヘルプ画面がみれるかな?

これでターミナルからsublimeText2が開けるようになりました。

このコマンドの便利な使いどころは
RubyOnRailsなどアプリケーションを作成した際に
アプリケーションフォルダの階層で

subl .

と入力するとカレントディレクトリ配下がsublimeTextで編集できるようになります。

 
はじめて subl . を実行した時の感動はやばかった!
これで作業スピードがかなりはやくなりました〜!

29
24
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
29
24