Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smartinsightsfromdata/fe8584a717bae42e2588e2f49321ce43 to your computer and use it in GitHub Desktop.
Save smartinsightsfromdata/fe8584a717bae42e2588e2f49321ce43 to your computer and use it in GitHub Desktop.
Sublime Text 3 on OS X Terminal

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment