0

Cmd-E enters the word under the cursor into the File search box. Is there anything similar for the Find in Files multiple search box?

I'd like to put the cursor on a word, hit a key combination, and have the Find in Files pane opened and with the word already filled in.

A previous answer Visual Studio Code find selected text in files suggests a command that appears to have been removed: workbench.action.findInFilesWithSelectedText

bronson
  • 5,612
  • 3
  • 31
  • 18
  • 1
    Have you tried ctrl+shift+f? – Felipe Malara Jan 23 '20 at 23:45
  • Wow! Ctrl-D and then Ctrl+Shift+F works. I would never have guessed. Do you know why Ctrl-F has Ctrl-E, but Ctrl-Shift-F has no equivalent? – bronson Jan 23 '20 at 23:56
  • I'll try to get in the habit of using Ctrl-D instead of Ctrl-E since Ctrl-D works consistently with both Ctrl-F and Ctrl-Shift-F. Thank you! – bronson Jan 24 '20 at 00:01
  • Ctrl+D is supposed to do something very different. Ctrl+F seeds the find widget, and Ctrl+Shift+F seeds the search pane (aka find in files). You shouldn't have to do Ctrl+D for this. – Mark Jan 24 '20 at 00:03
  • @Mark you're right, and I never noticed. Old habits die hard. So I guess Ctrl-E is useless nowadays? – bronson Jan 24 '20 at 00:24
  • Ctrl+E does the same as Ctrl+P now - opens the quickPanel for files. – Mark Jan 24 '20 at 00:26
  • On my system, the default bindings map Cmd+E to `actions.findWithSelection`, which now appears to be completely redundant? (sorry for being sloppy with 'Cmd' vs 'Ctrl') Also I appear to have an extension which prevents Ctrl+Shift+F from seeding the search pane. It works as you say when I start with --disable-extensions. More investigation to do! – bronson Jan 24 '20 at 00:33
  • Ah, found my source of confusion: the Find widget always gets seeded when I hit Cmd-F. The Find in Files panel only gets seeded if it's already blank. I would expect both would either always seed, or only seed when blank. – bronson Jan 24 '20 at 00:49
  • Ah, here's the answer: https://github.com/microsoft/vscode/issues/88160 – bronson Jan 24 '20 at 13:24
  • Restarting with extensions disabled also clears the search box... so I spent quite some time trying to figure out which extension was causing the issue. :) – bronson Jan 24 '20 at 13:32

0 Answers0