Settings
There are two ways to edit your settings in VSCode: through the UI and through the various settings.json
files. Settings, Shortcuts, Snippets and Extensions can be imported, exported and swapped between using the Profiles feature.
UI
VSCode provides a surprisingly powerful and useful UI for configuring your settings. You can access the Settings UI from the Command Palette with the Preferences: Open Settings (UI)
command or by using a Shortcut bound to workbench.action.openSettings
.
When you open the Settings UI, a menu on the left is provided that groups settings by category. I recommend just scrolling through these and exploring when you’re first getting started with VSCode. At some point, you are going to want to find things specifically, you can do so with the search bar. The search feature used to be pretty bad but Microsoft improved it somewhat so it’s fairly useful now.
But you can get even more specific using search filters. These are very useful. Let’s say you wanted a listing of every setting you’ve changed… you can use the @modified
filter. Just click the Filter Settings
icon to the right of the search bar and select Modified
. You will notice that the UI lists all settings that you have modified and that each modified setting has a colored bar next to it to indicate that it has been modified. You will also notice that the search bar has @modified
in it. You can type this out manually in the search bar or just type @
and use the Trigger Suggest
command (probably bound to ctrl+space) to get a list of all available filters. You can combine these filters as well. For example, typing @modified @ext:vscode.git
will show all settings for the built-in git extension that have been modified.
Here are a list of available filters:
@ext:*
- shows a complete listing of all settings for a particular extension where*
is the extension ID.@feature:*
- shows a complete listing of all settings for a particular feature where*
is the feature ID.@hasPolicy
- honestly, I’m not sure what this is does…@id:*
- shows the setting matching the setting ID (must be exact match!) where*
is the setting ID.@lang:*
- shows settings for a specific language where*
is the language. This will create a language-specific section in yoursettings.json
.@modified
- shows settings which have been changed from their defaults. Will show a colored bar to the left to indicate that the setting has been changed from its default.@tag:*
- shows settings pertaining to a specific tag where*
is the tag. For example,@tag:accessibility
will show accessibility settings.
Even though the @id:*
filter requires an exact match to show a setting, you can search using partial strings of settings IDs and it will show a fuzzy list of all settings that contain that substring. For example, searching for editor.
will show all settings that include that substring such as editor.fontSize
and workbench.editor.decorations.colors
.
Note the gear icon next to each setting when you hover over it with your mouse cursor. Clicking this icon gives you several useful options:
Reset Setting
- will reset that setting to its default.Copy Setting ID
- will copy that setting’s ID to your clipboard. You can also hover your mouse cursor over the setting to reveal a popup that will display the setting ID.Copy Setting as JSON
- will copy that setting’s ID and current value in JSON format to your clipboard.Copy Setting as URL
- will copy that setting’s ID in URL format to your clipboard. I don’t know how this is useful yet.Apply Setting to all Profiles
- will append this setting with its value tosettings.json (Application Settings)
along with a new value who’s key isworkbench.settings.applyToAllProfiles
and who’s value is an array of strings where each string is the setting’s ID.Sync This Setting
- will toggle whether or not this particular setting will be included in Settings Sync (see guide). All settings are synced by default. Un-syncing a setting will append a new value who’s key issettingsSync.ignoredSettings
and who’s value is an array of strings where each string is the setting’s ID.
You will notice that there are two tabs in the Settings UI. One labeled User
and the other labeled Workspace
. Both tabs show exactly the same settings, but changes under User
will apply to the current Profile and changes under Workspace
will apply only to the current Workspace. If you make changes under Workspace
, and no .vscode/
folder exists, VSCode will automatically create .vscode/settings.json
that will be loaded whenever that Workspace is opened up regardless of the Profile.
Note that settings changed in the UI will immediately be reflected in the appropriate settings.json
and vice versa.
settings.json
There are actually several settings.json
files that VSCode looks at. These get loaded in order and subsequent settings.json
files override any previous settings in a cascading fashion similar to the way CSS applies styles to a web page. Although these files have the same name, they are distinguishable by their file paths.
This is the hierarchy: Default Settings -> Application Settings -> User Settings -> Workspace Settings
So let’s look at an example:
// defaultSettings.json
{
...
"breadcrumbs.enabled": true,
"explorer.enableUndo": true,
"zenmode.centerLayout": true,
...
}
// settings.json (Application Settings)
{
...
"breadcrumbs.enabled": false,
"zenmode.centerLayout": false,
...
}
// settings.json (User Settings)
{
...
"breadcrumbs.enabled": true,
...
}
// settings.json (Workspace Settings)
{
...
"explorer.enableUndo": false,
"zenmode.centerLayout": true,
...
}
The end result will have breadcrumbs enabled, explorer undo disabled and zenmode center layout enabled.
VSCode provides great support for editing these files with IntelliSense. The Trigger Suggest
command gives autocomplete and brief descriptions for individual settings.
You can also click the pencil icon in the gutter next to a setting to see available values. Note that the pencil icon doesn’t show up for settings who’s value is a number…
TODO: Settings format. language-specific settings.
Pro Tip: You can keep your settings.json
files organized by using the JSON: Sort Document
command from the Command Palette.
defaultSettings.json
You can always use this file to inspect the default settings for VSCode. Note that this is a read-only file but extensions will append their default settings to it.
Accessible through the Command Palette with the command Preferences: Open Default Settings (JSON)
.
settings.json (Application Settings)
Holds global settings that apply to all Profiles. You can edit this file:
- Through the Command Palette with the command
Preferences: Open Application Settings (JSON)
. - By searching in the UI for
Workbench > Settings: Apply To All Profiles (Applies to all profiles)
and clicking onEdit in settings.json
. - By using the
workbench.action.openApplicationSettingsJson
command. - By directly accessing it through its file path. e.g.
/Users/username/Library/Application Support/Code/User/settings.json
on Mac.
Some settings can only be set at the Application level…
NOTE: As of right now, I dont know of any way to filter settings in the UI or JSON to show only those which are global (Applies to all profiles)
settings.json (User Settings)
Holds per-Profile settings. You can edit this file:
- Through the Command Palette with the command
Preferences: Open User Settings (JSON)
. - By setting
workbench.settings.editor
tojson
in the UI or in settings.json and then using theworkbench.action.openSettings
command. - By using the
workbench.action.openSettingsJson
command. - By directly accessing it through its file path e.g.
/Users/username/Library/Application Support/Code/User/profiles/profileID/
on Mac. - By clicking the Open Settings (JSON) button from the Settings UI.
settings.json (Workspace Settings)
Holds per-workspace settings. You can edit this file:
- Through the Command Palette with the command
Preferences: Open Workspace Settings (JSON)
. - By using the
workbench.action.openWorkspaceSettingsFile
command. - By opening Settings UI, clicking Workspace tab and clicking
Open Settings (JSON)
button. - Directly accessing it through its file path e.g.
.vscode/settings.json
from the open workspace.
Note that settings changed in settings.json
will immediately be reflected in the UI and vice versa.
Deprecated Settings
VSCode gets official updates every month and sometimes settings are removed or refactored. If a setting is grayed out in settings.json, it may have been deprecated.
See Also
- Official Docs Settings
- Workspace Guide
- Profiles Guide
- Settings Sync Guide
- Shortcuts Guide
- Command Pallete Guide