Sublime Text 3 on OS X Terminal
By creating link
Linking into /usr/bin with sudo:
$ sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/sbl
By creating alias
in .bash_profile file add line:
alias sbl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'
reopen Terminal or relaunch by:
$ source ~/.bash_profile
To run
# to open file
$ sbl <filename>
# to open current directory
$ sbl .
To use Sublime Text as default editor
set your EDITOR environment variable:
# with -w will not exit until the file is closed
$ export EDITOR='sbl -w'