Vscode: Find and Replace shortcut key

Created on 30 Mar 2020  路  8Comments  路  Source: microsoft/vscode

Issue Type: Bug

When doing a find and replace inside a file, the shortcut key to find next match is (Enter), and the shortcut key to replace is also (Enter), so I an unable to skip a match using just the keyboard because it will replace each entry.

VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:38:38.248Z)
OS version: Windows_NT x64 10.0.18362


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|15.84GB (2.61GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|


All 8 comments

You should be able to use F3 which is "Find Next"

Thanks for the tip! Perhaps its just a UI bug then, because The tooltip text reads "(Enter)" for both buttons in the UI.

Both are shortcuts for "Find next" and therefore any can be on the buttons, so this is not a bug.

This is 100% a valid bug. Sure, it may be 'only a UI bug', but it is painful. When you are doing a lot of searching and replacing, having to eyeball each one to make sure it is right - keyboard is MUCH faster than the mouse, we all know that. But the tooltip help that you get given is:

Next Match button: "Next Match (Enter)"
Replace button: "Replace (Enter)"

@IllusionMH : Enter is a shortcut for any button that is currently in focus, sure, but how is that helpful? Unless you didn't understand the bug in the first place ...

Initial problem is resolved - there is F3 that does what is needed in both contexts - Find and Find & Replace in contrast to Enter.

I know what "bug" you are talking about (it's not the first mention).
If you want to discuss what shortcut is displayed in hovers/menu/context menu - please check https://github.com/microsoft/vscode/issues/40389#issuecomment-352404326 and provide your feedback there or create another issue.

Another description https://github.com/microsoft/vscode/issues/27611#issuecomment-307008730

I also find the current keyboard shortcuts unsatisfactory. When I have the Replace panel open and move the text cursor to the editor (e.g. by pressing Ctrl+1) to edit something manually, pressing Enter means creating a newline. I can press F3 to _search_ again but I am not able to _replace_ again without using the mouse (edit: OK, Ctrl+H followed by Enter does it).

This is not essentially a problem of what is _displayed_ as @IllusionMH suggests. The problem is the keyboard _behavior_ while using Replace.

I am not able to replace again without using the mouse

You can always add your own shortcut for editor.action.replaceOne command and when can be like editorFocus && findWidgetVisible.

If you are sure that it should exist be for everyone by default - please create separate issue.

Was this page helpful?
0 / 5 - 0 ratings