I'd like to change the 'o' keybinding when in the file explorer of VS Code.
For a directory I'd like to keep the expand/collapse behavior, but for files I'd like the file to open (current behavior) and for the cursor to move to the editor.
I'd like to change the 'o' keybinding when in the file explorer of VS Code.
For a directory I'd like to keep the expand/collapse behavior, but for files I'd like the file to open (current behavior) and for the cursor to move to the editor.
You can do this with the following (open keybingings.json with Preferences: Open Keyboard Shortcuts (JSON)
in the command palette):
{
// open file and pass focus to editor
"key": "o",
"when": "filesExplorerFocus && !explorerResourceIsFolder",
"command": "explorer.openAndPassFocus"
},
{
// toggle folder folding
"key": "o",
"when": "filesExplorerFocus && explorerResourceIsFolder",
"command": "list.select"
}
If you still want to be able to type file names to do quick searches in the Explorer, try adding the following to the when-clauses && !inputFocus && !textInputFocus && !inInteractiveInput && !renameInputVisible
.