I'd like to be able to sync my VS Code user settings (File > Preferences > User Settings) to the cloud somehow so I can easily share them between multiple installations, as in Windows 10 and Visual Studio.
Is there a supported way of doing this? Direct support in Code would be great, but otherwise being able to move my settings.json location to a Dropbox or OneDrive folder would work too.
I'm looking specifically for a way of doing this automatically and silently. Manually exporting/importing is too cumbersome and isn't what I'm looking for.
Update: there's a feature request for this here. If you want this feature, please give it a thumbs up.
You can make a hard link from the directory containing user settings to your sync directory of applications such as Dropbox or OneDrive.
For example, on windows, the user settings are located in
%APPDATA%\Code\User
, so you could type:mklink /H /J X:\Your\Sync\Dir %APPDATA%\Code\User
on your computers with Visual Studio Code to achieve the synchronization.
Then, on another computer, you may delete the
%APPDATA%\Code\User
folder, and type:mklink /H /J %APPDATA%\Code\User X:\Your\Sync\Dir
to retrieve the synchronized settings.
I place my
settings.json
in a configuration file that I sync with git (though Dropbox would also work) and use a Python script to symlink it to the correct location for each platform so updating it from the settings menu syncs across my machines. Creating symlinks requires admin privileges on Windows.Use workspace-settings instead of user-settings.
User Settings
There is currently no automatic synchronization for user settings available in Visual Studio Code. On Windows the user settings are located in
%APPDATA%\Code\User\settings.json
. You could save a copy of that file on OneDrive or Dropbox and move it on all your machines to the user settings folder. But this still includes manual steps on each machine every time you change the configuration.You can suggest an automatic synchronization of settings here: https://visualstudio.uservoice.com/forums/293070-visual-studio-code
Workspace Settings
Add the
.vscode
folder of your workspace to the version control system (Git/SVN etc). When you checkout the code from the repository you will automatically get the VS Code workspace settings.Another way of doing it would be to soft link your files, which can also be stored in a repository on GitHub. For example, on Mac OS let's say you have a directory called
~/dev/dotfiles/vscode
. Let's say there are two files in there calledsettings.json
andkeybindings.json
. You could soft link these files with:If you are using Windows or Linux the path to the respective settings directories can be found at https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations
Aha, you can try my VSCode extension: Syncing.
Hoping you'll like it. :)
A Quick Guide
Install Syncing:
Get your own
GitHub Personal Access Token
:Login to your GitHub
Settings
page.Select
Personal access tokens
tab and clickGenerate new token
.Select
gist
and clickGenerate token
.Copy and backup your token.
Sync your settings:
Syncing
will ask for necessary informationfor the first time
andsave for later use
.Upload:
Type
upload
inVSCode Command Palette
.Enter your
GitHub Personal Access Token
.Enter your
Gist ID
(orleave it blank
to create automatically).Done!
After uploading, you can find your settings and the corresponding
Gist ID
in your GitHub Gist.Download:
Type
download
inVSCode Command Palette
.Enter your
GitHub Personal Access Token
(orleave it blank
if you want to download from a public Gist)Enter your
Gist ID
(or apublic Gist ID
).Done!