Launch Sublime Text 3 from command line

Wiped and reinstalled OS X on the MBP, thus lost the shortcut to invoke Sublime Text on command line.

Thought I should document this so I won’t have to go through Sublime Text directories in Applications.

Open up Terminal and run the following (assuming 1. Sublime Text is installed 2. /usr/local/bin is in your PATH)

Step 1: Go to Terminal; Check whether /usr/local/bin in in your PATH

echo $PATH

Terminal should return the following

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

/usr/local/bin is located at the end of the string. You’re set!

Step 2: Run the following on Terminal

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

Step 3: Test the setup by running the following:

subl .

This will kick in Sublime on the current directory.

 

Leave a Reply

Your email address will not be published. Required fields are marked *