Skip to content

Instantly share code, notes, and snippets.

@cosjef
Created November 13, 2016 15:06
Show Gist options
  • Save cosjef/760a902c91ce296361d9aa99312f85cd to your computer and use it in GitHub Desktop.
Save cosjef/760a902c91ce296361d9aa99312f85cd to your computer and use it in GitHub Desktop.
Launch Sublime Text from the CLI on a Mac
1) Install Sublime Text
2) Open terminal
3) Enter the following command to create a symlink: ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
4) Restart terminal
5) Try to open a local file with the command: subl <filename>
6) The file should open in Sublime Text
Its best to use command-line autocomplete when performing step 3, as version numbers for Sublime Text can (and do) change. More specifically, when typing the path, start at /Applications and use autocomplete to tread down to the /bin/subl directory instead of copy/pasting the text above. This will ensure you hit the proper target of the symlink.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment