Skip to content

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>"
}
}

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"
}
}

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
}
}

Set a themes

Set a theme in Visual Studio Code using the setTheme action.

{
"action": "setTheme",
"theme": "<theme name>"
}

Unset a theme

Unset a theme in Visual Studio Code using the unsetTheme action.

{
"action": "unsetTheme"
}

Set the presentation mode

Set the presentation mode in Visual Studio Code using the setPresentationMode action. This action turns on settings to hide the status bar, tabs, and activity bar.

{
"action": "setPresentationMode"
}

Unset the presentation mode

Unset the presentation mode in Visual Studio Code using the unsetPresentationMode action. This action turns off settings to show the status bar, tabs, and activity bar.

{
"action": "unsetPresentationMode"
}