Sublime Text 2 Service
Enable OSX Mountain Lion Context Menu Launch:
- Open Automator. Add new service.
- Search for "Run Shell Script". Drag over to the panel on the right (or double click it).
Enter:
/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl -a $@
- Set "Pass Input:" to "As Arguments"
- Set "Shell" to "bin/zsh"
- Set "Services Receives Selected:" to "files or folders"
- Save as "Open-in-Sublime".
To use: right-click on a file or folder, and click 'Open-in-Sublime' in the 'Services' menu at the bottom of the context menu.
Enable OSX Mountain Lion Terminal Launch:
At the command line enter:
sudo mkdir /usr/local/bin
Then enter:
sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
ln
creates a link.-s
makes it a symbolic link.- You may need to prefix the command with
sudo
if it doesn't work. - Restart the terminal.
To use:
user$ sublime .
[This will open the current folder structure in Sublime]
user$ sublime <filename>
[This will open the desired file in Sublime]
Try setting Pass input: value to as arguments.
And "/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl"
Path should in double quotes.