visual-studio-codevscode-keybinding

vscode use tab and shift tab for up and down in dropdown menu/quick open menus


When in drop down menus or quick open menus, by using keybindings like ctrl+p or ctrl+shift+p, how would I make it so tab and shift+tab go up/down the list?

Instead what happens when I use tab/shift+tab, is that it tabs across the editor.


Solution

  • This turns out to be trickier than I expected.

    First, I couldn't get it to work with Shift+Tab so you will see in the below that I used Ctrl+Tab instead.

    Second, in order to get the typical behaviour of stopping on an item and NOT having it automatically selected and run I had to use a different sort of command for the Ctrl+Tab entry.

    I suspect there is something hard-wired into the keybinding functionality of the quickOpen panels that is very hard to work around. But try this out in your keybindings.json:

    {
        "key": "tab",
        "command": "workbench.action.quickOpenNavigateNext",
        "when": "inQuickOpen"
    },
    
    {
        "key": "ctrl+tab",
        // should work but runs the selection immediately
        // "command": "workbench.action.quickOpenNavigatePrevious",
        "command": "list.focusUp",
        "when": "inQuickOpen"
    }