コマンド作成方法
コマンドの作成方法はこれ。
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
コマンドは既にアプリケーションの中に用意されているので、そのシンボリックリンクを作る形になります。~/bin/subl
の部分はPATHに設定されているディレクトリならどこでもOK。僕の場合は~/tools/bin/
に設定しました。
オプション
オプションもいくつかある様子。Sublime Text3でも問題なく動作しました。
$ subl --help Sublime Text build 3059 Usage: subl [arguments] [files] edit the given files or: subl [arguments] [directories] open the given directories or: subl [arguments] - edit stdin Arguments: --project: Load the given project --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.