529

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?

3
  • 13
    No, "Ctrl ," opens settings, it does not open the settings file. Commented Jul 21, 2023 at 9:39
  • @sevencardz has the answer for the asked question. Please update the selected answer. Currently it is random stuff unrelated to "click button to toggle between settings.json and the GUI view of it". Commented Oct 1, 2023 at 16:59
  • Answer via official VS Code docs Commented Oct 24, 2024 at 0:10

14 Answers 14

678

To open the User settings:

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

This image was taken in the VS Code online editor The dropdown list seen of the "open settings" options

Which, from the manual and 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 includes a button in the Settings UI gutter which can be used to switch between JSON and graphical view.

The location of the settings UI/JSON toggle in the top-right corner

The workbench.settings.editor option selects which of the settings files is opened by default when not using the above method, such as with the shortcut +, or through the application menu.

Footnotes

  1. The aforementioned settings, User and Workspace. Remote settings will appear when using WSL.

  2. By a test this maps to %APPDATA%\Roaming\Code\User\settings.json, I am not sure by what logic.

Sign up to request clarification or add additional context in comments.

14 Comments

This works for "local" settings, but not WSL, and that's the entire reason I need to get in. Apparently there's still a reference to my old wsl distro name (was 18.04, now 20.04). Know a way to get at that more manually, or where the location should be?
Found my reasonable solution. Since I was launching code from inside WSL, I created a dependency problem that prevented me from reloading WSL - Remote extension. I tried launching code directly from the WIndows .exe, but that didn't help. It then occurred to me to use File -> Close Remote Connection. That eliminated the WSL calls which in turn allowed me to uninstall/reinstall WSL - Remote and now I'm good again.
Glad you worked it out @rainabba. I use WSL as well, and this opens up the .vscode/settings.json in my subshell environment.
The fact that someone had to ask on StackOverflow about "how to view settings", and the fact that so many of us had to Google it, shows how much VS Code needs to be improved in terms of design.
With latest VSCode 1.84.2 the steps explained open a defaulSettings.json in read only mode. See also stackoverflow.com/questions/63211082/…
|
178

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"
}

5 Comments

This should be the top answer!
This is the right answer, the accepted answer is not opening the json file, instead it shows an empty json file
On Linux, the keyboard shortcut is Ctrl + , (comma).
yes this should be the top answer. thanks
This answer right here is the most useful. One click to switch back and forth.
25

Follow these steps:

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

Visual Studio Code Tips and Tricks

1 Comment

On Mac, presumably? Shift + Ctrl + P on Linux (e.g., with v. 1.67.1 (2002-05-06)).
23

I show you two ways to open settings.json.

<The 1st way>

  1. Open the Command Palette (F1 or Ctrl+Shift+P).
  2. Input settings.json to the Command Palette.
  3. Select Preferences: Open User Settings (JSON).

enter image description here

<The 2nd way>

  1. Click on Settings from ⚙️.

enter image description here

  1. Click on the mark as shown below.

enter image description here

1 Comment

Good to know about this secrete icon shown in the 2nd way.
18

To quickly find all 3 settings.json files:

  1. Press command + shift + p (or ctrl + shift + p on windows)
  2. Type > settings.json (don't forget the '>' at the start)

The beauty of this approach is it will auto suggest all the settings.json files - i.e. user settings, workspace settings, and default settings!

I find that very useful because I don't have to look up each one individually.

enter image description here

Comments

15

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.

3 Comments

I needed this local vscode settings file, +1
Does that work on Windows? Windows has trouble with files and folders only with a file extension.
I needed this local vscode settings file, +1
8

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

2 Comments

I have it located here: %APPDATA%\Roaming\Code\User\settings.json
On windows 10, AppData has three subdirectories Local, LocalLow, and Roaming but no Code directory as you and others seem to indicate. Dmitry is right its in the roaming folder. It also begs the question why on earth was it place there? It just seems so arbitrary.
6

On Windows, the default keybind to open the settings UI within VSCode is Ctrl + ,. From there, there is a button at the top right to "Open Settings (JSON)":

enter image description here

That is one way to get to it. For convenience, I have bound Ctrl + Shift + , to opening the settings JSON. For reference, the setting ID for that is workbench.action.openSettingsJson.

Comments

5
  1. Open VS Code.
  2. Go to settings by clicking the keyboard shortcut ctrl + , or with GUI
File -> Preferences -> Settings

Refer this image

GUI

  1. Click on the Open Settings (JSON) icon. Refer to the image

open settings.json

  1. Once you click on the icon it should open settings.json file

If still, that did not work.

  1. Go to the search bar and type json:scheme
  2. There click on Edit in settings.json. This should work.

edit settings for json

But still, if it hit you in the head with a brick please let me know.

Comments

4

In Just 2 steps


1- Hit the shortcut Ctrl+Shift+P (If you use a MAC it's +Shift+P):

enter image description here


2- Type in the search bar user settings json, and finally press Enter:

enter image description here

And you're done! Here you can change the general configs of VS Code in the settings.json.

However note that that there are also other types of settings.json which are relative to a project or a workspace for instance.

Comments

0

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

Comments

0

On Windows:

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

Select Preferences: open settings (JSON)

Comments

0

To find a specific setting, it's faster to use the left sidebar search to find the files and lines that setting is in. In my case VS Code kept saying The setting "editor.defaultFormatter" for Python is set to "ms-python.python" which is deprecated. despite me changing that everywhere i could find. Turns out there was a nested duplicate in C:\Users\<username>\AppData\Roaming\Code\User\settings.json:

    "[python]": {
        "editor.defaultFormatter": "ms-python.python"
    },

Comments

0

I solved this issue when using PNPM by creating a .npmrc with this:

# eslint doesn't work without these options. not sure why.
auto-install-peers=true
node-linker=hoisted

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.