Setting actions
Setting actions are used to perform actions related to settings in the editor. You can use these actions to update settings, change themes, and more.
Update a setting
Update a setting in Visual Studio Code using the setSetting action.
{ "action": "setSetting", "setting": { "key": "<setting key>", "value": "<value>" }}action: setSettingsetting: key: <setting key> value: <value>Example of updating a setting
Here is an example of how you can hide the activity and status bar in Visual Studio Code.
[ { "action": "setSetting", "setting": { "key": "workbench.statusBar.visible", "value": false } }, { "action": "setSetting", "setting": { "key": "workbench.activityBar.location", "value": "hidden" } }]- action: setSetting setting: key: workbench.statusBar.visible value: false- action: setSetting setting: key: workbench.activityBar.location value: hiddenTo reset the settings, you can use the following steps:
[ { "action": "setSetting", "setting": { "key": "workbench.statusBar.visible", "value": null } }, { "action": "setSetting", "setting": { "key": "workbench.activityBar.location", "value": null } }]- action: setSetting setting: key: workbench.statusBar.visible value: null- action: setSetting setting: key: workbench.activityBar.location value: nullSet a theme
Set a theme in Visual Studio Code using the setTheme action.
{ "action": "setTheme", "theme": "<theme name>"}action: setThemetheme: <theme name>Unset a theme
Unset a theme in Visual Studio Code using the unsetTheme action.
{ "action": "unsetTheme"}action: unsetThemeSet the presentation view
Set the presentation view in Visual Studio Code using the setPresentationView action. This action turns on settings to hide the status bar, tabs, and activity bar.
{ "action": "setPresentationView"}action: setPresentationViewUnset the presentation view
Unset the presentation view in Visual Studio Code using the unsetPresentationView action. This action turns off settings to show the status bar, tabs, and activity bar.
{ "action": "unsetPresentationView"}action: unsetPresentationViewBackup workspace settings
Back up your workspace settings using the backupSettings action. This copies your current .vscode/settings.json to .vscode/settings.backup.json (created if missing).
{ "action": "backupSettings"}action: backupSettingsRestore workspace settings
Restore your workspace settings from the backup using the restoreSettings action. This will overwrite .vscode/settings.json with the contents of .vscode/settings.backup.json. Use this when you want to revert changes made during a demo.
{ "action": "restoreSettings"}action: restoreSettings