Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Pew Pew Laser Blog Archives — by Blog ID

Sync Sublime Text Between Computers using Dropbox.

5.23.2013

Sublime Text 2 is my favorite text editor, and I use it on all of my machines - personal PC, personal Macbook, and work laptop (Windows). To make Sublime Text even more useful, I like to keep the same configuration of Sublime on each computer, which I can do by using Dropbox to sync the configuration files, and giving Sublime Text symbolic links (shortcut directories) to those files on Dropbox. (This also makes it super simple to configure my development environment on a new computer.) Here's how it's done:

Initial setup / first computer:

  1. Install Package Control into Sublime Text.
  2. Exit Sublime Text.
  3. Create a new directory called something like ST2 somewhere in Dropbox. Mine is at Dropbox\App Backups\Sublime.
  4. Find your ST2 user directory. It will contain directories named Installed Packages, Packages, Pristine Packages and Settings.
    • In Windows 7, this is usually C:\Users\[username]\AppData\Roaming\Sublime Text 2.
    • In Mac OS X, this is usually /Users/[username]/Library/Application Support/Sublime Text 2.
  5. Move Installed Packages, Packages and Pristine Packages from the ST2 user directory to the ST2 directory in Dropbox.
  6. Open up a Command Prompt or Terminal window with Administrator privileges (right click and choose "Run as Administrator") and navigate to your ST2 configuration directory.
    • In Windows 7, this is something like cd C:\Users\[username]\AppData\Roaming\Sublime Text 2.
    • In Mac OS X, this is something like cd /Users/[username]/Library/Application\ Support/Sublime\ Text\ 2/.
  7. Create a symbolic link for Installed Packages.
    • In Windows 7, this will be something like mklink /D "Installed Packages" "C:\[ST2 Dropbox directory]\Installed Packages".
    • In Mac OS X, this will be something like ln -s /[ST2 Dropbox directory]/Installed\ Packages ./Installed\ Packages.
  8. Repeat the above step for each of the other directories mentioned in step 4.
  9. Wait for Dropbox to finish syncing.
  10. Open ST2 and bask in your marvelous synced settings.

After ST2 configuration is on DB / Subsequent computers:

  1. Exit Sublime Text.
  2. In your ST2 user directory, delete or rename the Installed Packages, Packages and Pristine Packages directories. You'll be replacing them with the Dropbox ones.
  3. Open up a Command Prompt or Terminal window with Administrator privileges (right click and choose "Run as Administrator) and navigate to your ST2 configuration directory.
    • In Windows 7, this is something like cd C:\Users\[username]\AppData\Roaming\Sublime Text 2.
    • In Mac OS X, this is something like cd /Users/[username]/Library/Application\ Support/Sublime\ Text\ 2/.
  4. Create a symbolic link for Installed Packages, Packages and Pristine Packages directories.
    • In Windows 7, this will be something like mklink /D "Installed Packages" "C:\[ST2 Dropbox directory]\Installed Packages".
    • In Mac OS X, this will be something like ln -s /[ST2 Dropbox directory]/Installed\ Packages ./Installed\ Packages.
  5. Open ST2 and bask in your marvelous synced settings.

These steps will sync Snippets, Installed Packages and Color Schemes between every ST2 instance that you configure this way. It won't sync Projects or Recent Documents, but you could sync the Settings directory to enable this.

This basic process will work for any application that contains settings in a flat folder structure, such as many of Photoshop's configurations. You'd just need to figure out the specific directories that you need to sync. The process should also work on file synchronization systems other than Dropbox, such as Google Drive or Skydrive.

Permalink

Tags: dropbox sublime-text tooling

Authorized users may log-in to leave a comment.

Last Blog: Mothers' Day Paperweight.

Next Blog: The Checklist.