I want to customize my vscode for the keyboard only experience (sort-of).
Right now, if I open my file explorer and select via the arrow keys the needed file and press enter – it opens that file, focuses the editor (explorer gets unfocused) – but it does not close the file explorer.
So I need to press my combination to focus the explorer back, and then press that again – to close the explorer and focus back the editor.
My question is – how to close the explorer when I open a selected file?
I tried to find the command that is responsible for opening a new file, or an event, but did not find any solution…
2
Answers
You can achieve this functionality by editing your configuration by following these steps:
{}
icon at the top right to openkeybindings.json
.Then save the file and try it.
Explanation:
This setup allows you to close the Explorer when you press Enter after selecting a file. The
quickOpenNavigateNextInFilePicker
command ensures that the file opens, andcloseSidebar
will close the Explorer.You can use the
runCommands
command to run multiple commands.In this case, there are two commands you want to happen when you press enter:
list.select
workbench.action.closeSidebar
.To run both commands on enter, use the following keyboard shortcut: