- Sublime text 2 or 3 installed in your system within
Applicationsfolder
In order to launch sublime from command you only need to create a symlink /usr/local/bin/subl point to sublime app, to do so run the following in the command line.
ln -sv "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
type in command line
subl test.rb
it should open new file test.rb sublime text
NOTE: To accomplish this you must:
have created a directory where you actually place binaries /usr/local/bin if not make it before creating a symlink:
mkdir -p /usr/local/bin
have /usr/local/bin in your PATH environment variable, if not add by running the following command:
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
then reload the shell:
source ~/.bash_profile
test again.
This is awesome.