How can I open Visual Studio Code's 'settings.json' file?

Visual Studio-Code

Visual Studio-Code Problem Overview


I did it many times, and each time I forgot where it was.

Menu FilePreferencesSettings.

I get this:

Enter image description here

I want to open file settings.json (editable JSON file) instead. How can I do that?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

To open the User settings:

  • Open the command palette (either with F1 or Ctrl+Shift+P)
  • Type "open settings"
  • You are presented with two options, choose Open Settings (JSON)

Which, depending on platform, is one of:

  • Windows %APPDATA%\Code\User\settings.json
  • macOS $HOME/Library/Application\ Support/Code/User/settings.json
  • Linux $HOME/.config/Code/User/settings.json

The Workspace settings will be in a {workspaceName}.code-workspace file where you saved it, and the Folder settings will be in a .vscode folder if and when it has been created.


Official page on User and Workspace Settings

As stated by sevencardz below, VS Code now includes a button in the Settings UI gutter which can be used to switch between editor and graphical view. The workbench.settings.editor option selects which of these is opened by default when not using the above method, such as +, or through the application menu.

Solution 2 - Visual Studio-Code

On the settings UI page, there's a special button in the top right corner gutter that toggles between the settings.json file and the settings UI.

Open Settings (JSON)

Bonus Answer:

Add "workbench.settings.editor": "json" to your settings.json file. This will make it so that menu FilePreferencesSettings or + , opens your settings.json file by default. Optionally, add a comment at the top to remind yourself where the toggle button is.

// Click the Open Settings (UI) button in the top
// right corner gutter to toggle the settings UI
{
    // Other settings in settings.json
    // ...
    "workbench.settings.editor": "json"
}

Solution 3 - Visual Studio-Code

Follow these steps:

  • Shift + CMD + P
  • Type "settings"
  • Click on "Preferences: Open Settings (JSON)"

Visual Studio Code Tips and Tricks

Solution 4 - Visual Studio-Code

If you want to edit local workspace/folder settings instead of global user settings, you can edit the file .vscode/settings.json (shortcut: Ctrl/Cmd + P and type "settings.json").

If that settings.json file or the folder .vscode do not exist, you can create them in the folder directory.

These settings will apply to the specific project.

Solution 5 - Visual Studio-Code

These changes are global, so it will affect all of your projects.

  1. You can change the settings.json file from user preferences.

    Menu FilePreferencesSettingsExtensions → search for "Edit in settings.json"

  2. Eventually edit these files directly:

    • Linux: $HOME/.config/Code/User/settings.json
    • macOS: $HOME/Library/Application Support/Code/User/settings.json
    • Windows: %APPDATA%\Code\User\settings.json

Solution 6 - Visual Studio-Code

On Windows:

  • Click (Fn) + F1 (or Ctrl + P + >)
  • Type open settings json

Select Preferences: open settings (JSON)

Solution 7 - Visual Studio-Code

On a Mac the settings file is found at ~/Library/Application\ Support/Code/User/settings.json - it can be opened from the command line:

open -a 'visual studio code.app' ~/Library/Application\ Support/Code/User/settings.json

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKasheftinView Question on Stackoverflow
Solution 1 - Visual Studio-CodekluvinView Answer on Stackoverflow
Solution 2 - Visual Studio-CodesevencardzView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeMahdi NajjarianView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeCaxonView Answer on Stackoverflow
Solution 5 - Visual Studio-Codematson kepsonView Answer on Stackoverflow
Solution 6 - Visual Studio-CodeVan VuView Answer on Stackoverflow
Solution 7 - Visual Studio-CodePierzView Answer on Stackoverflow