Coda 2

Coda 2, one of my favourite code editors, was released on May 24th 2012 to a somewhat underwhelming reception, in my opinion.  To be 100% honest, I’m a bit disappointed with Coda 2, not for product or feature reasons, but because of the responses it has made some people come up with during their testing and usage of a brand new product.

I’m not going to review Coda 2 myself – plenty of other websites have already done that – but I am going to address one of the questions that seems to have come up a few times, despite Coda 2 still being a relative infant as I write this.

What question?

Synchronisation.  By that I mean the ability to maintain the same settings between multiple Macs running Coda 2.  The first thing I need to make clear is that if you purchase Coda 2 from the Mac App Store, iCloud synchronisation is already built-in but, if you buy Coda 2 directly from Panic, you can’t use iCloud to sychronise your configuration.  Panic’s own FAQ page has this to say about it:

At the moment, there is only one difference between the two versions: the Mac App Store version will support iCloud syncing of Sites and Clips, and the direct version will not. This is a restriction imposed by Apple.

So we’re screwed, right?

Well, no, and if we’re a little bit smart about it, the solution is relatively simple – Dropbox.  Given that OS X stores most application configuration in well-known locations like ~/Library/Application Support and ~/Library/Preferences, synchronising those directories with Dropbox is even easier than on competing operating systems that use things like the *gulp* registry.  By the way, in case you’re not sure, ~ means your home directory …

Others have written articles about how some of Coda’s competitors can be synchronised using Dropbox and this solution is really no different – all I’ve done is automate the process a bit.

How?

By moving the following bits to Dropbox:

  • The Coda 2 main configuration directory
  • The Coda 2 recent files list
  • The Coda 2 user preferences file

No really, how?

If you’re familiar with the term “symbolic link”, you’ll know what’s coming.  If you’re not, you can run the script below and everything will be done for you.  That said, you should be familiar with how to grab a script and, if necessary, make it executable – sorry but this isn’t the right place for me to explain how to do that (hint: chmod +x script_name).  Besides, I’d imagine readers of this article are relatively technical anyway, right?  😉

Anyway, grab the script below, edit the paths at the top if you need to, then run it.  A couple of warnings, though:

  • Before running the script on any Mac, please make sure Coda 2 has been run at least once
  • The first Mac you run this on should be the one where Coda 2 is configured how you’d like it
  • On subsequent Macs, you must make sure you you edit the script and change the first_run variable to FALSE before you run it … if you don’t, the existing Coda 2 configuration in Dropbox will be overwritten

The script will do a few checks while running, move your Coda 2 configuration to Dropbox, delete the local configuration and then create some symbolic links to the new Dropbox versions.  As far as Coda 2 is concerned, nothing has changed – it still operates as if the files are in the same place they’ve always been.