I usually have vs-code with the side bar and the command prompt panel open
And I have to successively press ctrl-b and ctrl-t to show hide each one of them and concentrate on the code
Is there a shortcut key to do both things?
I found this related issue
2
Answers
I tried fiddling with
runCommands
. You can give this a try (put in keybindings.json (open that file withPreferences: Open Keyboard Shortcuts (JSON)
in the command palette)):Some obvious limitations: if they are out of sync, ex. View is open and Panel is closed, then this will not put them back in sync. I’m not sure how to do that- I couldn’t find commands for strictly opening/closing instead of toggling. Also, I can’t figure out how to send focus back to the editor at the end of the sequence, and I don’t really understand how it’s decided what area of the UI gets focus at the end. Unfortunately, this is the best I can think of right now. Maybe someone can improve on this.
Try thess keybindings:
The order is important, vscode matches keybindings from the bottom of
keybindings.json
up and you want therunCommands
one evaluated last (as it doesn’t have awhen
clause and would always be triggered).These keybindings assume if one or the other sideBar/Panel are open you want to close it with the same keybinding as the main toggle. If you want to only open one when they are both closed. just use the standard keybindings for doing so.