Skip to content

Instantly share code, notes, and snippets.

@avioli
Forked from mikestone14/gist:11193365
Last active July 11, 2018 23:08
Show Gist options
  • Save avioli/bb36656469f1bf87c87df3618b523e54 to your computer and use it in GitHub Desktop.
Save avioli/bb36656469f1bf87c87df3618b523e54 to your computer and use it in GitHub Desktop.
Install Sublime Command Line Tool

Install Sublime 3 'subl' Command Line Tool

Check your $PATH if you have /usr/local/bin and if not add the following line to the very beginning of your ~/.bash_profile file (it is a hidden file).

export PATH="/usr/local/bin:$PATH"
# or if you want to be explicit where your SHELL will look for binaries:
# export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

If you want to edit the above hidden file in Sublime (and you are running OS X 10.9 and up):

  • Start Sublime and hit Cmd + O (or choose File > Open)
  • Navigate to your home directory - Cmd + Shift + H
  • Toggle the hidden files - Cmd + Shift + .
  • Find .bash_profile and hit Return (or the Open button)

Then create a link to the subl helper tool:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin
# NOTE: change /Applications to where it resides if you did put it in a different spot

To set up Sublime as the default editor in your ~/.bash_profile add this at the end of the file:

export EDITOR='subl -w'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment