visual-studio-codevscode-keybinding

vscode keyboard shortcut to navigate in the peek windows


VSCode has a number of peek functions (peek definition, implementation) so on. This opens a new peek window and a small file view on the right

Peek Window

Is there any keyboard shortcut which I can use to navigate to the editor peek window (the one that pops up) and the file navigation on the right.


Solution

  • Ctrl+K F2 (togglePeekWidgetFocus) can be used to focus the left panel of the peek view or to go from the left panel to the right panel (the file list view).

    Whenever I open the peek view focus is automatically transferred to the left panel of the peek view. But if you focus to the editor, the same keybinding mentioned above will switch focus to the left peek view panel.

    The keybinding is a little awkward so you might want to rebind it ala:

    {
      "key": "alt+g",          // whatever you want here
      "command": "togglePeekWidgetFocus",
      "when": "inReferenceSearchEditor || referenceSearchVisible"
    },
    {
      "key": "ctrl+k f2",
      "command": "-togglePeekWidgetFocus",
      "when": "inReferenceSearchEditor || referenceSearchVisible"
    }