Sublime Text Plugins for Automatic Document Versioning
Recently, I realized that I needed a way to keep track of versions of my plain text documents as they are written on my Mac. The main rationale for this was that there have frequently been times when I needed to restore data from a prior version of a document, either because the present version of the document became corrupted (rare, but it has happened and is actually what initially prompted this search) or because I wanted to compare/revert to previous wording that I had used in the document. Below, I list a few of the options that I considered for addressing this problem. I wrap up with the solution that I ultimately settled on.
One of the first things that occurred to me was that Dropbox saves prior versions of documents and lets you restore documents from a prior version. However, I quickly dismissed this option because I often write documents that contain sensitive information that I do not want to sync via Dropbox. The Dropbox solution is also a little cumbersome in that you need to go to the website to see the versioning options.
I know that Pages has an interface for viewing and restoring from prior versions of a document, but I also dismissed this option because I prefer to do my writing in a plain text editor (typically Sublime Text) versus a word processor like Pages.
Next, I considered a nice Mac app that I had previously heard of called Draft Control. It is a Mac app specifically designed for document versioning. It has a great interface with some nice features, including showing diffs between versions. However, I ultimately chose not to go with Draft Control for the limitation that the app has to be open to keep track of changes in a document. I could easily imagine my future self missing a prior version of a document because I had either quit or forgot to launch Draft Control while I was editing a document. There is also the limitation that documents have to be manually added to Draft Control for tracking. So while a nice app, it just wasn’t as automatic as what I was looking for.
I finally started making headway when I decided to search for Sublime Text packages that might solve this problem. An initial search in Will Bond’s Package Control site for “Version” and “Versions” returned a lot of irrelevant results of packages that referred to their version number or the Sublime Text compatible version in their README. However, a search for “backups” returned some relevant results, namely three Sublime Text packages that are designed for automatic version tracking of documents that are edited in Sublime Text. Two of the three packages (AutoBackups and Local History) are compatible with both Sublime Text versions 2 and 3. The third package (Automatic Backups) has a ST2 version available in the Package Control repository. A ST3 version is available on Github and appears to still be a work in progress, but it is currently functional on ST3 on my Mac.
There are slight differences between the three packages listed above, but they are all the same in that they provide automatic versioning for documents edited in Sublime Text. Specifically, any time you save your text file, the prior version is saved to a version directory (a folder somewhere in your file system - specific location depending on the plugin). Each of these packages then allow for at least viewing and sometimes restoring from a prior version. My favorite of the three is Automatic Backups, mainly for its keyboard shortcuts for quickly cycling back and forward through prior versions of a document to see and restore from prior versions. Viewing and restoring from prior versions in the other two packages (Local History and AutoBackups) is a little more cumbersome for me (and poorly documented).
One final point is that you can sync the version directory for a given package to your other computers using sync services like Dropbox, Transporter, or BitTorrent Sync. This means that your complete version history will be available on all of your computers.
In the end, I have been using the ST3 version of the Automatic Backups package. It has been nice to have complete and automatic versioning of all documents that I edit in Sublime Text.