Editing VSCode JSON Settings
Problem: Cannot Edit Default Settings in VSCode
When trying to edit VSCode's default settings through the JSON interface, users may encounter a "Cannot edit in read-only editor" error message. This occurs because:
- Default settings are intentionally non-editable in VSCode
- They serve as a reference for native and extension default values
- The blue line indicators in the settings UI show which values have been modified from defaults
- Only User Settings and Workspace Settings are meant to be modified
Solution: Enable JSON Settings Editing
VSCode provides two configurable settings scopes:
- User Settings: Apply globally to any VSCode instance
- Workspace Settings: Stored in your project's
.vscodefolder and override user settings
Method 1: Using Command Palette
The simplest way to access editable JSON settings:
Open Command Palette:
- Windows/Linux:
Ctrl+Shift+P - macOS:
Cmd+Shift+P
- Windows/Linux:
Type:
Preferences: Open Settings (JSON)Select the command to open your user settings JSON file
TIP
Workspace settings will override user settings. You can create workspace-specific settings by adding a .vscode/settings.json file in your project root.
Method 2: Change Default Settings Editor
Enable split JSON view for easier editing:
- Open Settings (
Ctrl+,orCmd+,) - Search for "Settings Editor"
- Under Workbench → Settings Editor:
- Change "Settings: Editor" from
UItoJSON - Enable "Settings: Use Split JSON" option
- Change "Settings: Editor" from
This creates a split-screen view with default settings on the left (read-only) and your editable settings on the right.
Key Settings for JSON Editing
Configure these in your settings.json for optimal JSON settings management:
{
"workbench.settings.editor": "json",
"workbench.settings.useSplitJSON": true,
"workbench.settings.openDefaultSettings": false
}WARNING
The default settings file is intentionally read-only. Never attempt to modify it directly, as your changes will be overwritten during VSCode updates.
Best Practices for Settings Management
- Use UI for discovery: Browse settings in the UI to find what you need
- Use JSON for bulk changes: Edit JSON for multiple settings or complex configurations
- Copy settings as JSON: Right-click any setting in UI and select "Copy Setting as JSON"
- Workspace-specific settings: Use project-level
.vscode/settings.jsonfor team consistency
Common Scenarios
Editing User Settings
// User settings.json location:
// Windows: %APPDATA%\Code\User\settings.json
// macOS: ~/Library/Application Support/Code/User/settings.json
// Linux: ~/.config/Code/User/settings.json
{
"editor.fontSize": 14,
"editor.tabSize": 2,
"files.autoSave": "afterDelay"
}Creating Workspace Settings
// .vscode/settings.json in your project root
{
"python.pythonPath": "venv/bin/python",
"editor.rulers": [80, 120],
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true
}
}Troubleshooting
If you still can't edit settings:
- Ensure VSCode has write permissions to your user directory
- Check for syntax errors in your settings.json file
- Reset settings with
Preferences: Open Default Settings (JSON)to view defaults
The split JSON editor provides the best of both worlds: reference defaults on the left with editable settings on the right, making configuration management in VSCode both accessible and powerful.