Use Dropbox to store your Sublime Text 2 settings, themes and plugins

After my last blog post on Fetch & Sublime, I thought let’s give another nice hint on how to get the most out of Sublime Text 2.

Sometimes you work on Windows, sometimes on Mac or Linux or just on another computer but you still want to use the settings, themes and set of plugins everywhere.  One of the easiest ways to do this is to use your DropBox account.

DropBox  is basically just a regular folder on you computer that syncs to the cloud.  The first 2 GB are free so if you use it to store documents you’re fine with the 2 GB.  You can however buy more space if required.  By inviting friends you can increase your Dropbox size (friend invite link).  Trust me it’s worth it, once you have Dropbox you wonder how you could live without it all these years.

The nice thing about Dropbox is it has versioning build right in, so even if you accidentally delete a file you can get it back.  Not only that you can set up shared folders to share documents between 2 or more people and even public folders to share with any internet user.

Ok but let’s go back to Sublime Text 2.

One thing you could do is store your projects on your DropBox  account that way all your projects are synced across all your devices.  But you could also store your settings, themes and plugins on DropBox.

How does it work?

On OS X

  1. First close Sublime Text 2
  2. In your Dropbox folder (usually it’s at “~/Dropbox/"), add a folder called “Sublime Text 2"
  3. Go to your Sublime Text 2 settings (this is usually at “~/Library/Application\ Support/Sublime\ Text\ 2/")
  4. Copy the following 3 folders into “~/Dropbox/Sublime\ Text\ 2/ "
    • "Installed Packages"
    • "Packages"
    • "Pristine Packages"
  5. Rename the 3 original folders in “~/Library/Application\ Support/Sublime\ Text\ 2/" or delete them.
  6. Next go back to Terminal
  7. From the command line type “cd ~/Library/Application\ Support/Sublime\ Text\ 2/" 
  8. "ln -s ~/Dropbox/Sublime\ Text\ 2/Installed\ Packages ./Installed\ Packages"
  9. "ln -s ~/Dropbox/Sublime\ Text\ 2/Packages ./Packages"
  10. "ln -s ~/Dropbox/Sublime\ Text\ 2/Pristine\ Packages ./Pristine\ Packages"

Start Sublime Text 2 and you’ll be linked to Dropbox.

On your other devices do

  • "mv ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User /tmp"
  • "ln -s ~/Dropbox/Sublime\ Text\ 2/Packages/User ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User"

On Windows

you can probably figure out the first part but for the symlinks you can use the syntax below:

  • mklink /D "Installed Packages" "C:\path\to\Dropbox\appdata\sublime\Installed Packages" 
  • mklink /D "Packages" "C:\path\to\Dropbox\apps\sublime\Packages" 
  • mklink /D "Pristine Packages" "C:\path\to\Dropbox\apps\sublime\Pristine Packages"

On Linux

I presume the Linux setup is similar to the Mac setup but if your using Linux you probably know your way around the command line enough to figure out how to do this once you get the idea.
  • http://run-around.com Gedrick

    Solid idea! Just implemented this on my work/home computer :) Thanks for posting.

  • Pingback: Sublime Text 2 « Macdrifter

  • Luis Porras

    Hi,

    I think the second command on “On your other devices do” should be:

    “ln -s ~/Dropbox/Sublime\ Text\ 2/Packages/User ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User”

  • Pingback: Sublime Text as an Emacs Replacement

  • Christine Fuchs

    If you have to work with foreign devices (at work, for example) like I have to, you probably not want to do this. Any harm which results could be endanger your private and work life.

    • admin

      @Christine Fuchs Could you explain a little what is the issue with foreign devices? I haven’t had any problems with it syncing to an iPad & Android phone.

      If the symlinks bother you might want to look at Cubby.com (I’ve just sent you an invite). Cubby allows to share any folder you like and even allows to share p2p with without any data limit.

  • Daniel Voogsgerd

    I like idea of syncing across multiple OS, but there is one issue for me. If I were to sync a project file from my windows machine to my linux or mac machine, the paths to folders wouldn’t work due to different pathsystems.
    e.g.
    Linux; /home/daniel/randomfolder/
    Windows; C:/randomfolder/

    • Hector Alvarez

      i made a simple pyhon script to modify the sublime.project file. works perfectly

  • Pingback: Sublime Text 2の設定をDropboxで同期する方法 | おいのブログ

  • http://tranbot.net kipenzam

    Excellent tip, but I have a problem with theme. I love Soda theme, but it doesn’ work in Windows machine. I made symlink in Windows, and it works very well, very well so that it copied theme settings to windows :(

    Can.. you exclude theme setting? I guess not, but need help.

  • Pingback: Sublime Text 2 con Dropbox – Cyneek

  • Pingback: Sublime Text 2のいろいろ › blog.azzip-azzip.com

  • 1990banks

    Followed every step still no luck. Spent just under 4 hours re-reading and trying out different solutions, yet to no avail.
    I’m constantly getting syntax errors and file already exists, but I can’t seem to find the file.

    So I’m pretty much on the edge of manually backing up my ST2 Settings.

    I’m using windows 7 home premium x64.

    Sublime text 2.0.1 x64.

    Some help would be highly appreciated.

  • arjamizo

    you can also use parameter

    sublime –data ~/Dropbox/Sublime_config
    in sublime

  • Alex Marino

    What about Sublime Text 3?
    I’m getting mixed results. There is now a Local directory that cannot be made into a symlink unless one has the exact same projects on the other computers.