Understanding Settings Scopes
VS Code supports multiple settings scopes, allowing you to configure different behaviors for different contexts:User Settings
Global settings that apply to all VS Code instances. Stored in your user profile directory.Location:
~/.config/Code/User/settings.json (Linux/macOS) or %APPDATA%\Code\User\settings.json (Windows)Workspace settings take precedence over user settings. This allows you to have different configurations for different projects.
Accessing Settings
You can access and edit settings in multiple ways:Using the Settings UI
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P) - Type “Preferences: Open Settings (UI)”
- Browse or search for settings in the visual interface
Editing Settings JSON
For direct JSON editing:- Open the Command Palette
- Type “Preferences: Open Settings (JSON)” for user settings
- Or “Preferences: Open Workspace Settings (JSON)” for workspace settings
Common Settings Examples
Here are real-world settings examples from the VS Code codebase:Editor Configuration
settings.json
Language-Specific Settings
You can configure settings for specific languages using the[languageId] syntax:
settings.json
Files Configuration
settings.json
Search Configuration
Control which files and folders are excluded from search:settings.json
Git Configuration
settings.json
TypeScript/JavaScript Configuration
settings.json
Workspace Settings Example
For project-specific configuration, create.vscode/settings.json in your project:
.vscode/settings.json
Settings Schema
VS Code validates your settings against a JSON schema. The editor provides:- IntelliSense for available settings
- Descriptions and default values
- Type validation
- Enum value suggestions
Finding Setting IDs
To find the JSON identifier for a setting:- Open the Settings UI
- Find the setting you want
- Hover over the setting name to see its identifier
- Or use the gear icon next to the setting and select “Copy Setting ID”
Read-Only Files
You can mark certain files as read-only to prevent accidental edits:settings.json
Settings Sync
VS Code can synchronize your user settings across different machines:- Sign in with your Microsoft or GitHub account
- Enable Settings Sync from the Command Palette
- Choose which settings to sync (settings, keybindings, extensions, etc.)
Next Steps
Keybindings
Customize keyboard shortcuts
Themes
Personalize colors and icons