Adding Sublime Text 2 to the command line

I recently started using Sublime Text 2 as my code editor of choice (testing the waters to see if it’s better than TextMate), but one thing I really missed was being able to open projects from the command line. Most of my work starts out with a version control update followed immediately by mate whatever.

This behavior is surprisingly easy to implement for Sublime Text 2:

  1. Open up the file ~/.bash_profile
  2. Add a line that says alias subl='open -a Sublime\ Text\ 2.app'

You can change the subl alias to whatever works best for you. Now you can type subl ~/svn/projectname/ and Sublime will open up with your project already loaded.


 
 
 

Comments are closed.