Skip to content
Brian Mayo edited this page Oct 8, 2018 · 17 revisions

Supported since v3.2

VS Code Settings Sync supports per-os and per-host inline settings. Keywords: "@sync", "@sync-ignore", "os", "host", "env".

Per host settings

Apply settings only if it matches with the hostName

hostName must be set in syncLocalSettings.json. More info here

Usage:

  // @sync host=Laptop
  "window.zoomLevel": 1

Per OS

Suported OS values: linux, windows, mac. Usage:

  // @sync os=linux
  "window.zoomLevel": 1

ENV variables

Settings will apply if the env variable exists in process.env. Usage:

  // @sync env=ENV_VAR
  "window.zoomLevel": 1

Ignore settings upload

You can disable upload of specific settings. Usage:

  // @sync-ignore
  "window.zoomLevel": 1 // this won't be uploaded neither downloaded

Examples:

  // @sync os=linux host=Laptop
  "window.zoomLevel": 1,

  // @sync host=PC
  "window.zoomLevel": 2,

  // @sync os=linux host=Laptop env=ENV_CUSTOM
  "window.zoomLevel": 3,

  // @sync os=linux env=WORK
  "window.zoomLevel": 3,

  // @sync-ignore
  "editor.renderIndentGuides": false

How it works?

Before uploading your settings.json all the settings with inline pragmas are uncommented. When your settings are download they will be processed and all the settings that don't match with your machine (OS, hostName or ENV variables) will be commented.