How to store Sublime Text preferences in Github How to store Sublime Text preferences in Github git git

How to store Sublime Text preferences in Github


Store Package Control/User

You only need to add the ~/Library/Application Support/Sublime Text 3/Package Control/User/ (or on Windows: C:\Users\{username}\AppData\Roaming\Sublime Text 3\Packages\User) directory.

From https://packagecontrol.io/docs/syncing

The proper solution is to install Package Control on all machines and then to sync only the Packages/User/ folder. This folder contains the Package Control.sublime-settings file, which includes a list of all installed packages. If this file is copied to another machine, the next time Sublime Text is started, Package Control will install the correct version of any missing packages.

Steps to set it up

Create a new repo on github, name it something like "sublime-prefs", then run these commands:

cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/Usergit initgit add Package\ Control.sublime-settingsgit commit -am "settings from from <device name>"git remote add origin https://github.com/<github name>/<repo name>.gitgit push -u origin master

Pulling down to other machines...

Quit Sublime Text 3, then run these commands (using answer from How do I clone into a non-empty directory?):

cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/git initgit remote add origin https://github.com/<github name>/<repo name>.gitrm Package\ Control.sublime-settingsgit fetchgit checkout -t origin/master