How To Sync Your TextMate Bundles Across Multiple Macs Using Dropbox

If you’re a TextMate user like myself who happens to have multiple Macs (say, one at home and one at work), keeping your Bundles in sync can be a bit of a hassle. Sure, you can stick to the Bundles from the GetBundles repository, but what if you want to have your own customizations? Keeping them in sync across all of your machines would be great—fortunately, thanks to Dropbox this is an easy and completely hassle-free possibility!

All you need is a Dropbox account, but since the service is free and extremely useful, you probably already have one. No? Well go sign up!

Here’s what we’re going to do: we’re going to use the simple power of symbolic links (a.k.a. symlinks) to make sure you have all your bundles in sync on all your Macs. The only thing you’ll ever need to do after this initial setup is hit the Reload Bundles command when you’ve added or edited a bundle on one Mac and are now switching to another.

First use the Finder to navigate to your Dropbox folder (typically found at ~/Dropbox/) and create a new folder in there named Bundles. You can give it a different name if you’d like but you’ll have to adjust accordingly in the instructions further down.

Next, open Terminal and enter the following command:

cd ~/Library/Application Support/TextMate/

If you don’t have that folder you either don’t have TextMate installed or your TextMate support folder is elsewhere — if it’s the latter, you’ll have to locate it yourself.

Next up:

open ./

This opens up a Finder window to the TextMate support folder. Look inside the Bundles folder (if it exists) and if you have any Bundles in there, move them all to the Bundles folder inside your Dropbox (or whatever you named that folder). After you make sure you have your Bundles stored in and uploaded to your Dropbox, go back to the Terminal, where you should still be located at the TextMate support folder, and enter this command:

rm Bundles

Since the Bundles folder should be empty at this point, you shouldn’t get any error back from the rmcommand.

Now for the symlink:

ln -s ~/Dropbox/Bundles/ Bundles

This will create a new Bundles folder which links to your ~/Dropbox/Bundles/ folder, which in turn will automatically sync up and down any changes you make.

After you’ve done all this, you’ll only ever have to hit Reload Bundles when changing from one Mac to another if you’ve made any Bundle changes.

Note: I’ve encountered some strange behavior by TextMate (a bug?) that sometimes comes into play with bundles I’ve already edited. If you find that a bundle isn’t syncing, manually remove the .tmbundle file from your ~/Dropbox/Bundles/ folder while having TextMate open, then within TextMate open the Bundle Editor and drag your bundle from the Editor onto your ~/Dropbox/Bundles/ folder. After that, it should work just fine again.

If you liked this, you should follow me on Twitter!