These days I find myself developing from multiple computers / operating systems (Linux at home vs Mac at work) and I found it frustrating having to manually keep my Sublime Text 2 settings and packages in sync on every computer that I use. However I recently discovered that it's actually quite easy to sync the Sublime Text 2 setting files between computers using Dropbox and some symbolic links. This works because the Sublime Text 2 setting files are the same across all operating systems. Below is how I set this up.
On the primary computer, create a symbolic link from the Sublime Text 2 Packages
directory to a location in the Dropbox directory.
Linux
cd ~/Dropbox
ln -s ~/.config/sublime-text-2/Packages sublime-text-2-settings
Mac
cd ~/Dropbox
ln -s ~/'Library/Application Support/Sublime Text 2/Packages' sublime-text-2-settings
Windows
cd %HOMEPATH%\Dropbox
mklink /D sublime-text-2-settings "AppData\Roaming\Sublime Text 2\Packages"
Then on every other computer create a symbolic link from the location in Dropbox to the Packages
directory (make sure to close Sublime Text 2 and delete the existing Packages
directory first).
Linux
cd ~/.config/sublime-text-2
rm -R Packages
ln -s ~/Dropbox/sublime-text-2-settings Packages
Mac
cd ~/'Library/Application Support/Sublime Text 2'
rm -R Packages
ln -s ~/Dropbox/sublime-text-2-settings Packages
Windows
cd "%HOMEPATH%\AppData\Roaming\Sublime Text 2"
rd /S /Q Packages
mklink /D Packages %HOMEPATH%\Dropbox\sublime-text-2-settings
This technique also works for other programs, such as for syncing Minecraft saves between computers.
GitHub Comments
dentz
Rowno
qaid
valtido
miohtama
valtido
Rowno
add comment via GitHubIf i change settings on other devices will it sync and update on the primary computer?
thanks for the tutorial.
@dntz Yes
Fellow githubber @miohtama created a pretty simple and useful script to run that will do all of this for you:
https://github.com/miohtama/ztanesh/blob/master/zsh-scripts/bin/setup-sync-sublime-over-dropbox.sh
I'm all in favor of command line joy, but I'm also in favor of saving time and reducing chances of errors. Gave it a shot and the script works fine.
OMG, it makes so much sense, I am beating myself up about how I could not have thought about this before :)
🍺
Oops, You may want to run the CMD (windows) on admin mode (as administrator)
Really? That's odd. I was able to create symbolic links as a normal user, but then again this is windows we're talking about. 😉