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", "args": { "setting": "workbench.statusBar.visible", "value": false } }, { "action": "setSetting", "args": { "setting": "workbench.activityBar.location", "value": "hidden" } }]
- action: setSetting args: setting: workbench.statusBar.visible value: false- action: setSetting args: setting: workbench.activityBar.location value: hidden
To 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: null
Set 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: unsetTheme
Set 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: setPresentationView
Unset 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: unsetPresentationView