337

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kasheftin
  • 7,509
  • 11
  • 41
  • 68
  • 1
    There are multiple ways to do this. But You're looking for `Ctrl` + `,` (or `Command` + `,` on a Mac.) Nowadays here is the [fastest way to open settings.json in vscode](https://www.youtube.com/watch?v=pmhMHAgPPdU), hope this helps. – InfiniteStack Aug 14 '22 at 18:57
  • 1
    No, "Ctrl ," opens settings, it does not open the settings file. – AriesConnolly Jul 21 '23 at 09:39

11 Answers11

424

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.

kluvin
  • 5,235
  • 3
  • 13
  • 20
  • 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? – rainabba Nov 22 '21 at 17:54
  • 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. – rainabba Nov 22 '21 at 18:16
  • 1
    Glad you worked it out @rainabba. I use WSL as well, and this opens up the `.vscode/settings.json` in my subshell environment. – kluvin Nov 25 '21 at 14:33
  • is your `.vscode/settings.json` in your project? I think because `.vscode` is related to a project, not the workspace. But how can you create a project settings.json other than [manual](https://stackoverflow.com/a/68166475/1705829) as seen further down? Probably you can create only manually. – Timo Feb 24 '22 at 07:28
  • I'm not sure this is true for Windows. Windows 10 has three folders Local, LocalLow and Roaming in the AppData folder. – Andrew S Mar 24 '22 at 02:37
  • Re *"You are presented with two options"*: In version 1.67.1 (2022-05-06), there are six options. – Peter Mortensen May 12 '22 at 14:31
  • One or more ([annotated](https://meta.stackexchange.com/questions/19478/the-many-memes-of-meta/19775#19775)) screenshots wouldn't go amiss. – Peter Mortensen May 12 '22 at 14:34
  • 1
    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. – Nav Aug 23 '22 at 16:00
  • @AndrewS I clarified this as a footnote – kluvin Oct 15 '22 at 09:07
  • @PeterMortensen added image links while the imgur integration is down. What six options are these? I count five in the VS Code Online editor – kluvin Oct 15 '22 at 09:09
  • When you say `%APPDATA%\Roaming`, you mean `%UserProfile%\AppData\Roaming`, right? The `%AppData%` env var doesn't point to the `AppData` directory, confusingly. But I'm not using Windows ATM so I'm not totally sure and I can't check. – wjandrea Feb 12 '23 at 23:54
  • Oh, this white label Open Settings (JSON) is just a tooltip of the actual small button. They made it so small I am always forgetting where this is. – Radzor Jul 16 '23 at 12:02
138

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"
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sevencardz
  • 1,539
  • 1
  • 10
  • 3
22

Follow these steps:

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

Visual Studio Code Tips and Tricks

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mahdi Najjarian
  • 237
  • 2
  • 4
10

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Caxon
  • 109
  • 1
  • 5
7

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mati kepa
  • 2,543
  • 19
  • 24
  • 2
    I have it located here: %APPDATA%\Roaming\Code\User\settings.json – Dmitry Feb 17 '22 at 08:16
  • 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. – Andrew S Mar 24 '22 at 02:39
4

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.

Cloud
  • 938
  • 1
  • 8
  • 24
3
  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.

3

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

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
2

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.

underflow
  • 1,545
  • 1
  • 5
  • 19
0

On Windows:

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

Select Preferences: open settings (JSON)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Van Vu
  • 9
  • 1
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
Pierz
  • 7,064
  • 52
  • 59