In VS Code I often find myself with multiple panels open (the terminal and the sidebar). I have keyboard shortcuts (cmd+b
and cmd+t
) to toggle the panels.
If the terminal isn't focused, then I have to do cmd+t
twice to close. Once to focus, then again to toggle it off.
So in the end when I want to close all the panels and just focus on writing code I have to do cmd+t
cmd+t
cmd+b
just to get to writing.
There has to be a way to close multiple panels at once.
The Commands extension. You could do a lot of powerful things with this extension. But for now, this is what I did to close both panels at once.
I added this to my settings.json
to create a sequence of commands.
"commands.commands": {
"Close Panels": {
"sequence": [
"workbench.action.closePanel",
"workbench.action.closeSidebar"
]
}
}
Then I added this to my key bindings to get have the command run with the chord cmd+k cmd+m
.
{
"key": "cmd+k cmd+m",
"command": "Close Panels"
}
Now it's super easy to close panels and get to writing code. I love little things like this to improve my workflow.