For the past couple of years, I’ve been using Espresso as my text editor of choice. A few months ago, I decided to give Sublime Text 2 a whirl and haven’t looked back since. And for the most part, I’ve completely switched to ST2. One of the first things I did (and wrote about) was how to sync my Espresso environment using Dropbox. Today, I’m writing about how to do the same for Sublime Text 2 (big thanks to this article for pointing me in the right direction).

Note: these instructions are for Mac users, sorry to you Windows fans.

First things first, make sure you have Sublime Text close before moving on.

Next, we’ll set up our Dropbox environment. I have a folder called “Apps” with separate folders for each application that syncs using Dropbox, so my set up is Dropbox > Apps > Sublime Text 2.

Open Sublime Text 2 and go to Preferences > Browse Packages; this will take you to the ST2 settings folder in Finder. Copy the “Installed Packages”, “Packages”, and “Pristine Packages” folders to your ST2 Dropbox folder. Delete these folders from the ST2 Application Support folder once they’ve been copied into your Dropbox.

Next, fire up Terminal and cd to the Sublime Text settings folder, it should look something like this:

cd ~/Library/Application\ Support/Sublime\ Text\ 2/

Last, we create symlinks for each folder so each folder we deleted now points to your Dropbox.

ln -s ~/Dropbox/Apps/Sublime\ Text\ 2/Installed\ Packages ./Installed\ Packages
ln -s ~/Dropbox/Apps/Sublime\ Text\ 2/Packages ./Packages
ln -s ~/Dropbox/Apps/Sublime\ Text\ 2/Pristine\ Packages ./Pristine\ Packages

Open up Sublime Text and you should be good to go! Repeat the process on each computer you’d like Sublime Text to sync with.