VS Code’s settings.json files are described in its documentation,
User and Workspace Settings, which this page follows. The keys themselves
are thousands of setting IDs, defined by VS Code and by each installed extension; their
list is VS Code’s default settings (the command Preferences: Open Default Settings
(JSON)), and is not repeated here.
Syntax
The file is JSON as VS Code’s “JSON with Comments” parser reads it:
//line comments and/* … */block comments are allowed.- A trailing comma after the last member of an object or array is tolerated (VS Code’s JSON editing page: accepted but discouraged, with a warning).
- The top level is one object; keys are setting IDs such as
editor.fontSize, written flat with their dots, not nested.
Where settings files are
| Scope | File |
|---|---|
| User, Windows | %APPDATA%\Code\User\settings.json |
| User, macOS | ~/Library/Application Support/Code/User/settings.json |
| User, Linux | ~/.config/Code/User/settings.json |
| Profile | …/Code/User/profiles/profile ID/settings.json, made when a setting is first changed in that profile |
| Workspace (one folder) | .vscode/settings.json in the folder |
| Multi-root workspace | The settings object in the .code-workspace file |
| Workspace folder | .vscode/settings.json in each folder of a multi-root workspace |
Builds other than the stable release use their own folder name in place of
Code, such as Code - Insiders.
Language-specific settings
{
"editor.tabSize": 2,
"[python]": { "editor.tabSize": 4 },
"[javascript][typescript]": { "editor.formatOnSave": true }
}
A key made of one or more language IDs in square brackets holds settings that apply
only to files in those languages. A single-language block wins over a block that lists
several; precedence goes by the whole bracketed key, so
"[typescript][javascript]" does not override
"[javascript]".
Precedence
From lowest to highest; each later scope overrides the earlier ones:
- Default settings
- User settings
- Remote settings
- Workspace settings
- Workspace folder settings
- Language-specific default settings
- Language-specific user settings
- Language-specific remote settings
- Language-specific workspace settings
- Language-specific workspace folder settings
- Policy settings set by an administrator, which always win
Strings, numbers, booleans and arrays from a higher scope replace lower ones; object
values (such as workbench.colorCustomizations) are merged key by key, the
higher scope winning where keys clash. A few settings that run programs, such as
git.path and terminal.external.windowsExec, are ignored in
workspace settings.