'How can I open Visual Studio Code's 'settings.json' file?
Solution 1:[1]
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:[2]
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.
Bonus Answer:
Add "workbench.settings.editor": "json" to your settings.json file. This will make it so that menu File ? Preferences ? Settings 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:[3]
Follow these steps:
- Shift + CMD + P
- Type "settings"
- Click on "Preferences: Open Settings (JSON)"
Solution 4:[4]
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:[5]
These changes are global, so it will affect all of your projects.
You can change the settings.json file from user preferences.
Menu File ? Preferences ? Settings ? Extensions ? search for "Edit in settings.json"
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
- Linux:
Solution 6:[6]
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
Solution 7:[7]
On Windows:
- Click (Fn) + F1 (or Ctrl + P + >)
- Type open settings json
Select Preferences: open settings (JSON)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Peter Mortensen |
Solution 3 | Peter Mortensen |
Solution 4 | Peter Mortensen |
Solution 5 | Peter Mortensen |
Solution 6 | Pierz |
Solution 7 | Peter Mortensen |