How to open settings.json in VS Code [6 Ways]

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
5 min

banner

# Open settings.json using the Command Palette

The fastest way to open settings.json in VS Code is to use the Command Palette:

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: You can also press F1 to open the Command Palette.
  1. Type user settings json.

  2. Click on Preferences: Open User Settings (JSON)

preferences open user settings

The command directly opens your settings.json file.

settings json file opened

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.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: You can also press F1 to open the Command Palette.
  1. Type workspace settings json.

  2. Click on Preferences: Open Workspace Settings (JSON)

open workspace settings json

The editor will open your local settings.json file which is located in the .vscode/settings.json directory.

open local settings json

If you don't have a .vscode/settings.json file, an empty file is created.

The .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:

  • it only applies to the current project.
  • it overrides any global configuration set in the global settings.json file.

# Open settings.json using by clicking on the icon

You can also click on the corresponding icon to open your settings.json file.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing:

  • Ctrl + , (comma) on Windows and Linux or
  • Cmd + , (comma) on macOS

click on icon to open settings json

  1. Click on the Open Settings (JSON) icon in the top right corner.

Here is a short clip that demonstrates the process.

open user settings using icon

# Open settings.json using the cogwheel icon

You can also use the cogwheel icon at the bottom left corner.

The icon is located at the bottom of the Activity bar.

click cogwheel icon

  1. Click on the cogwheel icon and select Settings.
  2. Click on the Open Settings (JSON) icon in the top right corner.

click on icon to open settings json

Here is a short clip that demonstrates the process.

open settings json using cogwheel icon

As previously noted, you can also use the following keyboard shortcut to open the settings screen.

  • Ctrl + , (comma) on Windows and Linux or
  • Cmd + , (comma) on macOS

open settings json using ctrl comma

# Open settings.json using the top menu

You can also open the settings.json file using the top menu.

On Windows and Linux:

  1. Click on File in the top menu and then select Preferences -> Settings.
  2. NOTE: You might have to press Alt to show the top menu on Windows and Linux.

file preferences settings

On macOS:

  1. Click on Code in the top menu then select Preferences -> Settings.

Then click on the Open Settings (JSON) icon in the top right corner.

click on icon to open settings json

# Open settings.json directly

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:

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

On Windows, the path resolves to:

  • C:\Users\YOUR_USER\AppData\Roaming\Code\User

view settings json file on windows

You can use the following commands to open your settings.json file directly.

On Windows, start CMD and issue the following command.

cmd
# Windows code %APPDATA%\Code\User\settings.json

open settings json directly on windows

On macOS, run the following command in bash or zsh.

shell
# macOS code $HOME/Library/Application\ Support/Code/User/settings.json

On Linux, run the following command in bash or zsh.

shell
# Linux code $HOME/.config/Code/User/settings.json

open-settings-json-directly-on-linux

The command opens your global settings.json file in Visual Studio Code.

# Opening your default settings.json file

If you need to open your default settings.json file:

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type default settings and select Preferences: Open Default Settings (JSON).

open default settings json

The file contains VS Code's default (unedited) settings.json file.

default settings json file

You can use the file to compare the value of a specific property in your settings.json vs the default configuration.

The file is also very heavily commented, so you can use it to read about the values of certain properties you need to set.

# You can edit most settings using the graphic user interface

Note that you can edit most settings using the graphic user interface.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing Ctrl + , on Windows and Linux or Cmd + , on macOS.

  1. Start typing in the search field and the corresponding settings will render.

type to filter for specific settings

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.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.