Introduction
Visual Studio Code keeps its settings in
files named settings.json. The user settings apply everywhere and live in
the user’s profile: %APPDATA%\Code\User\settings.json on Windows,
~/Library/Application Support/Code/User/settings.json on macOS and
~/.config/Code/User/settings.json on Linux. Workspace settings, in a
project’s .vscode/settings.json, override them for that project and are
often shared with the code.
The Settings screen in VS Code edits the same files, and the command “Open User Settings (JSON)” opens the file itself. Editors built on VS Code, such as VSCodium, use the same format in their own folders.
Structure
The file is JSON with two relaxations, which
VS Code calls JSON with Comments: // and /* */ comments are
allowed, and a trailing comma is tolerated. The top level is one object. Its keys are
setting IDs with dotted names, such as editor.fontSize or
files.autoSave, and are not nested by their dots. A key made of a language
name in square brackets, such as "[python]", holds an object of settings
that apply only to that language.
{
// Editor
"editor.fontSize": 14,
"files.autoSave": "afterDelay",
"[python]": {
"editor.tabSize": 4
}
}
Also used for
- GeoJSON .json
- Hugging Face model config (config.json) .json
- Hugging Face tokenizer (tokenizer.json) .json
- JSON Schema .json
- JavaScript Object Notation .json
- Lottie animation .json
- npm package manifest (package.json) .json
Links
Software
- Visual Studio Code (Windows, macOS, Linux)
- VSCodium (Windows, macOS, Linux)
Developers
- jsonc-parser, the JavaScript library VS Code uses to read and edit JSON with comments
Reference
- User and workspace settings, Visual Studio Code documentation