Launch Sublime Text 2 from the Mac OS X Terminal
Sublime Text 2 ships with a CLI called subl.
Sublime recommends using these instructions to symlink subl but I think subl is hard to remember and most of us don't use the folder they recommend. Most of us have the following in our PATH:
Setting up Terminal
The following command symlinks sublime to subl
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
If you had to add
/usr/local/bin to your PATH, run the following command before continuing:
This will reload your
.bash_profile with the newly added directory.
Open a Terminal window and run:
sublime filename (replace "filename" by an actual file name)
sublime foldername (replace "foldername" by an actual folder name)
sublime . (to open the entire current directory)