bnieland
bnieland

Reputation: 6496

vscode key binding for "goto next search result on the search results pane"?

Is there a vscode key binding for "goto next search result on the search results pane"?

I could not find it in the keybindings json or on http://code.visualstudio.com/docs/customization/keybindings, but the descriptions are not always that great and I might have missed it!

Upvotes: 123

Views: 30782

Answers (7)

Conor Hyde
Conor Hyde

Reputation: 11

For "Ctrl+F" situation, you can use F3 or Shift+F3 to navigate to next occurrence or previous one, even the focus is not in the search bar.

Upvotes: -4

Jason Song
Jason Song

Reputation: 2660

try use the ctrl+down and ctrl+up as we have such default config:

{
  "key": "ctrl+up",
  "command": "search.action.focusSearchFromResults",
  "when": "accessibilityModeEnabled && searchViewletVisible || firstMatchFocus && searchViewletVisible"
}
{
  "key": "ctrl+down",
  "command": "search.focus.nextInputBox",
  "when": "inSearchEditor && inputBoxFocus || inputBoxFocus && searchViewletVisible"
}

Upvotes: 0

Andy Liu
Andy Liu

Reputation: 55

The highest score answer seems to be out of date.

The current key binding is F3, which works for me on Windows.

Upvotes: 2

Christy
Christy

Reputation: 245

I know this is an old post, but, it's all I can find on Stack Overflow so, throwing in what I wish I'd found here. If I search (Ctrl+F), just hitting Enter and Shift+Enter take me to the next and previous occurrence of the match. F4 doesn't work for me (on Fedora).

Upvotes: -1

joeytwiddle
joeytwiddle

Reputation: 31285

If you are planning to rebind F4 and Shift-F4 to different keys, please note that there are multiple actions bound to those keys. For consistent behaviour, you may wish to rebind them all.

{ "key": "f4",         "command": "goToNextReferenceFromEmbeddedEditor",       "when": "inReferenceSearchEditor"  },
{ "key": "shift+f4",   "command": "goToPreviousReferenceFromEmbeddedEditor",   "when": "inReferenceSearchEditor"  },
{ "key": "f4",         "command": "search.action.focusNextSearchResult",       "when": "hasSearchResult"          },
{ "key": "shift+f4",   "command": "search.action.focusPreviousSearchResult",   "when": "hasSearchResult"          },
{ "key": "f4",         "command": "goToNextReference",                         "when": "referenceSearchVisible"   },
{ "key": "shift+f4",   "command": "goToPreviousReference",                     "when": "referenceSearchVisible"   },
{ "key": "f4",         "command": "references-view.next",                      "when": "reference-list.hasResult" },
{ "key": "shift+f4",   "command": "references-view.prev",                      "when": "reference-list.hasResult" },

In case VSCode has added any new keybinds since this answer, I recommend you open the Keyboard Shortcuts window and search for Shift+F4 there.

Upvotes: 18

Wosi
Wosi

Reputation: 45243

New in version 1.9.0

Execute search.action.focusNextSearchResult (F4)

and search.action.focusPreviousSearchResult (CTRL+F4)

Original answer

Unfortunately there is currently no command to go to the next entry in the search result pane. As a workaround you can execute workbench.view.search (by default* bound to CTRL+Shift+f) and navigate to the next item via and select it with ENTER.

When you have executed actions.find (by default bound to Shift+f) in order to find text in the current file only, then you can use the editor.action.nextMatchFindAction command which is usually bound to F3. Its default binding is declared like this:

{ 
  "key": "f3",                    "command": "editor.action.nextMatchFindAction",
                                  "when": "editorFocus" 
}

The default shortcuts are based on the Windows version of VSCode

Upvotes: 19

Rhys van der Waerden
Rhys van der Waerden

Reputation: 3837

This is now supported.

  • F4 next search result
  • Shift + F4 previous search result

Upvotes: 168

Related Questions