Muppet
Muppet

Reputation: 6029

Changing hotkeys when using "find all" in VS Code

In VSCode, when using the "Find all" functionality by pressing ctrl+shift+f, I'd like to have two quality-of-life improvements:

  1. I'd like to be able to just press down to get to the result field, without having to press tab 6 times.
  2. I'd like to be able to exit the "Find all" section and return to the editor view by just pressing esc.

Can this be done via the shortcut system in VSCode? How?

Upvotes: 0

Views: 56

Answers (1)

Mark
Mark

Reputation: 180885

There is a command search.action.focusNextSearchResult that will take you to the first result. By default, it is bound to F4. But you could change that to:

{
  "key": "down",
  "command": "search.focus.nextInputBox",
  "when": "inputBoxFocus && searchViewletVisible || inSearchEditor && inputBoxFocus"
}

For the switch focus to the last active editor part of your question, try this keybinding:

{
  "key": "escape",
  "command": "workbench.action.focusActiveEditorGroup",
  "when": "searchViewletVisible"
}

Upvotes: 1

Related Questions