![]() |
| Some settings of mine |
Turns out, synchronizing ST3 is actually very simple if you use any kind of file hosting and synchronization service, such as Dropbox.
There are discussions out there on how to do it with Sublime Text 2, but not so much with version 3. That being said, the steps are almost identical and you would certainly figure it out yourself. But hey, you won't even have to!
Syncing Sublime
The steps below should to be done on the computer that has your most up-to-date ST3 settings (the ones you want to propagate to other computers).
Before doing anything, close Sublime Text 3, just to be clean.
# Create the sync directory in Dropbox $ mkdir ~/Dropbox/sublime-text-3/ # Move your ST3 "Packages" and "Installed Packages" to Dropbox $ cd ~/.config/sublime-text-3/ $ mv Packages/ ~/Dropbox/sublime-text-3/ $ mv Installed\ Packages/ ~/Dropbox/sublime-text-3/ # Then symlink your Dropbox directories back locally $ ln -s ~/Dropbox/sublime-text-3/Packages/ $ ln -s ~/Dropbox/sublime-text-3/Installed\ Packages/
Note that ST3 has three other directories under ~/.config.sublime-text-3/: Cache, Index and Local. Do not sync these, each computer should manage their own local copies.
Syncing other computers
All other computers will now have ~/Dropbox/sublime-text-3/. Follow these steps on each of the computers you have ST3 installed to sync them:
# Remove the "outdated" directories $ cd ~/.config/sublime-text-3/ $ rm -rf Packages/ $ rm -rf Installed\ Packages/ # Then symlink your Dropbox directories back locally $ ln -s ~/Dropbox/sublime-text-3/Packages/ $ ln -s ~/Dropbox/sublime-text-3/Installed\ Packages/
Now when you tweak to your Sublime Text 3 settings, they will propagate automatically. Even new packages get installed everywhere! You'll always feel at home, wherever you are!

On a Mac, replace the ~/.config/sublime-text-3 with ~/Library/Application\ Support/Sublime\ Text\ 3 and everything else works as described above.
ReplyDeleteEven easier remember Dropbox can backup symlinks so
ReplyDelete$ mkdir ~/Dropbox/sublime-text-3/
$ ln -s ~/.config/sublime-text-3/Packages/ ~/Dropbox/sublime-text-3/Packages/
$ ln -s ~/.config/sublime-text-3/Installed\ Packages/ ~/Dropbox/sublime-text-3/Installed\ Packages/
then sync others with interactive force overwrite
$ ln -sFi ~/Dropbox/sublime-text-3/Packages/ ~/.config/sublime-text-3/Packages/
$ ln -sFi ~/Dropbox/sublime-text-3/Installed\ Packages/ ~/.config/sublime-text-3/Installed\ Packages/
That approach is very dangerous. In the event that Sublime Text is removed on the master computer, the files will be removed from Dropbox as well as from all of the synced computers. Alex's implementation is far superior.
DeleteDan, Dropbox has a history for deleted files...
DeleteWhen creating the symbolic links on the mac make sure not to include the trailing "/" or it will complaint about "./" file exists. Use something like:
ReplyDeleteln -s ~/Dropbox/sublime-text-3/Packages
Thanks Will!
ReplyDeleteI've done this and I love it, having synced settings is, dare i say it, sublime. My issue is triggering snippets with key bindings: i have this:
ReplyDelete{ "keys": ["super+shift+alt+p"], "command": "insert_snippet", "args": {"name": "Packages/PHP/php.sublime-snippet"}},
which works perfectly to insert the snippet that comes with sublime. but adding anything that triggers a snippet inside that symlinked folder does not work. i have tried and if i duplicate my snippet inside a non symlinked folder all is well. any thoughts?
BitTorrent Sync means you can just point BTS at the original 'full' two folders and create secret shares, one for each, then on the receiving computer, after installing vanilla ST3, del those two folders and ask BTS to create the two folders, with the contents of the original share. Long explanation but actually simple and no need for symlinks etc. I ditched a lot of stuff I used to do with DropBox and use BTS, it's fab.
ReplyDeleteUpdate: Still using BTS but this explanation is, I think, more precise: https://sublime.wbond.net/docs/syncing
ReplyDeleteThe setup described in the article leads to the situation when ST3 settings and keymap are not reloaded automatically: https://www.sublimetext.com/forum/viewtopic.php?f=3&t=13976&start=10#p54979
ReplyDeleteThank you! I created a powershell script for setting this up. Once I get it tuned, I'll see if I share it.
ReplyDeletewhat about the files in %appdata% aren't they necessary, it's my understanding that user preferences are often there, am i wrong?
ReplyDeleteThis is a bad method of syncing.
ReplyDeleteAs it is stated on the Package Control website: " To properly sync your installed packages across different machines, you actually do not want to sync the whole Packages/ and Installed Packages/ folders. The reason for this is that some packages have different versions for different operating systems. By syncing the actual package contents across operating systems, you will possibly run into broken packages."
https://packagecontrol.io/docs/
+1
DeleteWish I had read this before attempting, my sublime packages broke and I got a series of looping errors
DeleteI have used Backup and Restore Dropbox of plugin for several years and i can confirm that this is the best Plugin ever. and would like to i recommend for anyone because is easy. safe and secured to use. https://wordpress.org/plugins/dropbox-backup/
ReplyDelete