Last updated: Apr 6, 2024
Reading time·5 min
The fastest way to open settings.json
in VS Code is to use the Command
Palette:
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.Type user settings json.
Click on Preferences: Open User Settings (JSON)
The command directly opens your settings.json
file.
The User settings.json
file is applied globally (to all projects of the
currently logged-in user).
On the other hand, there is a Workspace settings.json
file that is only
applied to the current workspace (project).
All settings stored in your workspace settings.json
file override any global
configuration.
You can use the same approach to open your workspace settings.json
file.
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.Type workspace settings json.
Click on Preferences: Open Workspace Settings (JSON)
The editor will open your local settings.json
file which is located in the
.vscode/settings.json
directory.
If you don't have a .vscode/settings.json
file, an empty file is created.
.vscode/settings.json
file is easily accessible as the .vscode
folder is located in the root directory of your project.Things to note about the .vscode/settings.json
file:
settings.json
file.You can also click on the corresponding icon to open your settings.json
file.
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.You can also open the settings screen by pressing:
Ctrl
+ ,
(comma) on Windows and Linux orCmd
+ ,
(comma) on macOSHere is a short clip that demonstrates the process.
You can also use the cogwheel icon at the bottom left corner.
The icon is located at the bottom of the Activity bar.
Here is a short clip that demonstrates the process.
As previously noted, you can also use the following keyboard shortcut to open the settings screen.
Ctrl
+ ,
(comma) on Windows and Linux orCmd
+ ,
(comma) on macOSYou can also open the settings.json
file using the top menu.
On Windows and Linux:
Alt
to show the top menu on Windows and
Linux.On macOS:
Then click on the Open Settings (JSON) icon in the top right corner.
An alternative approach is to open the settings.json
file directly.
Here are the paths to the settings.json
file depending on your operating
system:
%APPDATA%\Code\User\settings.json
$HOME/Library/Application\ Support/Code/User/settings.json
$HOME/.config/Code/User/settings.json
On Windows, the path resolves to:
C:\Users\YOUR_USER\AppData\Roaming\Code\User
You can use the following commands to open your settings.json
file directly.
On Windows, start CMD and issue the following command.
# Windows code %APPDATA%\Code\User\settings.json
On macOS, run the following command in bash
or zsh
.
# macOS code $HOME/Library/Application\ Support/Code/User/settings.json
On Linux, run the following command in bash
or zsh
.
# Linux code $HOME/.config/Code/User/settings.json
The command opens your global settings.json
file in Visual Studio Code.
If you need to open your default settings.json
file:
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.The file contains VS Code's default (unedited) settings.json
file.
You can use the file to compare the value of a specific property in your
settings.json
vs the default configuration.
Note that you can edit most settings using the graphic user interface.
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.You can also open the settings screen by pressing Ctrl
+ ,
on Windows and
Linux or Cmd
+ ,
on macOS.
If you update a specific setting using the graphic user interface, VS Code
automatically adds the property and value to your settings.json
file.
Most of the time, you don't have to edit the JSON file directly and should stick to using the graphic user interface, unless you are copy-pasting settings from somewhere.
I've also written an article on how to reset VS Code to the default settings.
You can learn more about the related topics by checking out the following tutorials: