Skip to content

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 .vscode folder and override user settings

Method 1: Using Command Palette

The simplest way to access editable JSON settings:

  1. Open Command Palette:

    • Windows/Linux: Ctrl+Shift+P
    • macOS: Cmd+Shift+P
  2. Type: Preferences: Open Settings (JSON)

  3. 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:

  1. Open Settings (Ctrl+, or Cmd+,)
  2. Search for "Settings Editor"
  3. Under Workbench → Settings Editor:
    • Change "Settings: Editor" from UI to JSON
    • Enable "Settings: Use Split JSON" option

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:

json
{
  "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

  1. Use UI for discovery: Browse settings in the UI to find what you need
  2. Use JSON for bulk changes: Edit JSON for multiple settings or complex configurations
  3. Copy settings as JSON: Right-click any setting in UI and select "Copy Setting as JSON"
  4. Workspace-specific settings: Use project-level .vscode/settings.json for team consistency

Common Scenarios

Editing User Settings

json
// 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

json
// .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:

  1. Ensure VSCode has write permissions to your user directory
  2. Check for syntax errors in your settings.json file
  3. 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.