Launch Sublime Text 2 from CLI

Just a quicky today: I recently saw a co-worker launch Sublime Text 2 from his OS X Terminal window. The sublime workspace appeared instantly with the his current working directory loaded in the ‘Folders’ view.

Some quick googling turned up this gist that provided the simple solution of creating a symbolic link using the following command:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

 

The gist mentions some drawbacks and the “official” way to set this up, but being that my machine is a development machine, this simple trick will suffice.