After a couple weeks of trying other code editors, I’ve decided to primarily use the feature-packed Sublime Text 3. One of the biggest advantages in Sublime Text (to name one feature out of the hundreds included) is the ability to install custom Packages that allow for an intense level of customization and functionality.

If you’re like me and use multiple computers throughout the week – I use a MacBook and PC at work and an iMac and MacBook at home – it becomes increasingly important to have your standard development setup available on all computers. I have always used Dropbox to sync files, photos, and basically everything else between all of my devices, but being able to sync settings and configurations with Dropbox is an added bonus! In this post I’ll explain how to set up Dropbox to sync your Sublime Text settings and packages across all of your computers.

Sublime Text is a sophisticated text editor for code, markup and prose. You’ll love the slick user interface, extraordinary features and amazing performance.

The best solution for syncing Sublime Text along with your installed packages, regardless of whether you choose to sync with Dropbox or by another method, is to only sync the Packages/User/ directory. This folder contains the Package Control.sublime-settings file, which among other things, contains your list of installed packages. Once this file is synced with your other machines via the process outlined below, your other computers will automatically install the correct version of any missing/updated package the next time you start up Sublime Text.

There are other ways to sync your installed packages and settings across different machines without utilizing Dropbox, for example by using Git, however I have found that using other methods leads to added steps of constantly syncing files, updating repositories, and the list goes on. Dropbox sync allows for the cleanest, most “hands-off” approach.

Getting Started

I recommend designating one of your computers as your “initial computer.” Once you configure your Sublime Text settings on this initial machine to your liking, we will be syncing these files with Dropbox.

Before proceeding, you should also have your Dropbox account syncing between all of your computers. I won’t go into the details of installing and enabling Dropbox here, but the Dropbox website should provide plenty of instruction. As to which folders to sync to your computers via Dropbox, we will be creating a new folder in Step Four, so hang tight and read on. 1

Download Sublime Text

If not already installed, Download a fresh copy of Sublime Text 3 to get up and running. Instructions may vary depending on your operating system.

Install Package Control

If you have not yet installed Package Control, go ahead and open up Sublime Text. Once you have Sublime Text up-and-running, from its menu select View > Show Console. Alternatively, utilize the keyboard shortcut ctrl+` to show the console.

Once the console is open, simply paste the code found on the Package Control installation page and press return. This code creates the Installed Packages folder for you, then downloads the Package Control.sublime-package. After Package Control installation has completed, quit/exit Sublime Text.

IMPORTANT
The method outlined in this post assumes that you install Package Control on all machines prior to setting up the sync workflow. The install code for Package Control changes with every release. Be sure to use the code found at the link included above that corresponds to your version of Sublime Text.

Setup Initial Machine

These instructions assume your Dropbox folder is installed in the default location ~/Dropbox. If your Dropbox folder is located elsewhere, you should replace all mentions of ~/Dropbox below with the correct path, such as ~/Path/to/Dropbox. The initial setup instructions vary depending on whether your main (initial) computer is a Mac or a PC running Windows

If initial machine is a Mac

If your initial machine is a Mac, first follow the instructions below

  1. Close down Sublime Text
  2. Open Terminal and input the following commands
    # Navigate to the Sublime Text 3 Package directory
    cd ~/Library/Application Support/Sublime Text 3/Packages/
    
    # Create a Sync Folder within your Dropbox, and then within the Sync folder, create a Sublime Text folder.
    # You may reuse the Sync folder for other purposes/applications
    mkdir ~/Dropbox/Sync/Sublime Text
    
    # Move the User folder from the Sublime Text 3 Package directory to your new Dropbox folder.
    mv User ~/Dropbox/Sync/Sublime Text/
    
    # Create a symlink within the Sublime Text 3 Package directory pointing to the User folder within Dropbox/Sync/Sublime Text/ directory.
    ln -s ~/Dropbox/Sync/Sublime Text/User
    

If initial machine is running Windows

If your initial machine is running Windows, first follow the instructions below

  1. Close down Sublime Text
  2. Open PowerShell by right-clicking and selecting “Run as administrator” and then enter the following commands
    # Navigate to the Sublime Text 3 Package directory
    cd "$env:appdata\Sublime Text 3\Packages"
    
    # Create a Sync Folder within your Dropbox, and then within the Sync folder, create a Sublime Text folder.
    # You may reuse the Sync folder for other purposes/applications
    mkdir $env:userprofile\Dropbox\Sync\Sublime Text
    
    # Move the User folder from the Sublime Text 3 Package directory to your new Dropbox folder.
    mv User "$env:userprofile\Dropbox\Sync\Sublime Text"
    
    # Create a symlink within the Sublime Text 3 Package directory pointing to the User folder within Dropbox/Sync/Sublime Text/ directory.
    cmd /c mklink /D User "$env:userprofile\Dropbox\Sync\Sublime Text\User"
    

Configure Other Computers for Sync

After completing the instructions outlined above based on your initial machine’s OS, next follow the instructions below for ALL OTHER machines, depending on their operating system.

If a secondary computer is a Mac

  1. Close down Sublime Text
  2. Open Terminal and input the following commands
    # Navigate to the Sublime Text 3 Package directory.
    cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
    
    # Delete the User folder within this directory.
    rm -r User
    
    # Create a symlink within the Sublime Text 3 Package directory pointing to the User folder within Dropbox/Sync/Sublime Text/ directory.
    ln -s ~/Dropbox/Sync/Sublime\ Text/User
    

If a secondary computer is running Windows

  1. Close down Sublime Text
  2. Open PowerShell by right-clicking and selecting “Run as administrator” and then enter the following commands
    # Navigate to the Sublime Text 3 Package directory.
    cd "$env:appdata\Sublime Text 3\Packages"
    
    # Delete the User folder within this directory.
    rmdir -recurse User
    
    # Create a symlink within the Sublime Text 3 Package directory pointing to the User folder within Dropbox/Sync/Sublime Text/ directory.
    cmd /c mklink /D User "$env:userprofile\Dropbox\Sync\Sublime Text\User"
    

Once you complete the secondary computer changes above, your instances of Sublime Text on each computer should automatically update whenever you make a change to your installed packages. Additionally, any changes made to your User Settings in the Preferences.sublime-settings file will also be updated. This method should allow for the perfect developer space regardless of which of your computers you’re working from.

1. Instructions are republished from PackageControl.io.