Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Last active October 13, 2015 08:18
Show Gist options
  • Select an option

  • Save mikermcneil/4166902 to your computer and use it in GitHub Desktop.

Select an option

Save mikermcneil/4166902 to your computer and use it in GitHub Desktop.
How to use Sublime Text 2 from the command line (OS X)
# Add an alias to your .profile directly access the sublime binary
echo >> ~/.profile
echo 'alias sublime="/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl"' >> ~/.profile
# Make sublime your default text editor
echo >> ~/.profile
echo 'export EDITOR="subl -w"' >> ~/.profile
# Refresh your bash .profile
source ~/.profile
# More info available here:
# http://www.sublimetext.com/docs/2/osx_command_line.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment