Setting up and Configuring Sublime Text 2

Add an "Open In Sublime" Service to the Finder

To Setup the Open in Sublime Text in the Finder, make a new Automator Action, you want to have it run a shell script with the following contents:

/Applications/Sublime\ Text\ -n "$@"

Notice the escapes for the spaces in the application path. The other changes you need to make are:

  • Set "Service receives selected" to "files or folders"

  • Set "in" to ""

  • Set "Pass input" to "as argumets"

It should look like this.

This is a placeholder image until aws-20121229-1314-01 is found

Note: There's another way to do this with just using the "Open Finder Items with", but that was advised against. I'm not really sure why, but the above works fine.

Launching Sublime Text from the Command Line

Create a symbolic link to the executable like this:

sudo ln -s /Applications/Sublime\ Text\ /bin/subl

This will let you open a directory in Sublime Text by using the standard dot command:

subl .

Note that you also have a version that links "st"

sudo ln -s /Applications/Sublime\ Text\ /bin/st

So, you can do:

st .