How do I shut off the new Explorer Ctrl+F Find tool in VSC?
Asked Answered
C

3

23

I realize that Microsoft had some sort of reason for adding the new "Find" tool in the folder EXPLORER section of VSC.. but... I'm a creature of habit. When I click on a file and then press Ctrl+F, I immediately start typing the value I'm looking for. The results used to look like this in the file editor pane...

enter image description here

But with my last update, when I click on the file in the EXPLORER and press Ctrl+F, I am now getting this NEW small tool in the EXPLORER pane, and the cursor goes THERE. I type away and nothing happens in the file editor until I swear a few near-curse-words and have to click over in the file editor and then press Ctrl+F again and start all over to type the search string. It's bugging me because its old habit.

enter image description here

How can I go back to the old way of how it worked? Is there a simple configuration buried somewhere I can change?

Thanks.

Contend answered 15/9, 2022 at 23:34 Comment(0)
T
17

I don't see a setting to set the old filter-search method as the default in the Explorer. You can disable the list.find command on which the new find widget in the Explorer depends in your keybindings.json which has the effect you want:

  {
    "key": "ctrl+f",
    "command": "-list.find",
    // "when": "listFocus && listSupportsFind"
  }

Now Ctrl+F with focus in the Explorer will open the editor Find Widget with focus.

But you lose the ability to filter other lists with the Ctrl+F, such as TreeViews (see https://mcmap.net/q/585993/-is-it-possible-to-add-search-filter-box-to-a-tree-view-component forexample).


The better solution, IMO, is to set up a macro which works when you have explorerFocus and use the Ctrl+F keybinding. Use this keybinding in your keybindings.json:

{
  "key": "ctrl+f",
  "command": "runCommands",
  "args": {
    "commands": [
      "workbench.action.focusActiveEditorGroup",
      "actions.find",
    ],
    "when": "explorerFocus"
  },
}

which will switch focus to your current editor and then open the Find Widget therein.

Tinny answered 16/9, 2022 at 4:20 Comment(2)
The first one worked for me! Thanks. My IDE nightmare is over. Chuckle.Contend
I'm on a Mac so maybe it's different to Windows, but simply removing the cmd-F keybinding for list.find (using Preferences > Keyboard Shortcuts) worked for me. Now pressing cmd-F always starts searching in the current editor pane, even if the explorer pane was focused - just like it used to be. No need for a macro.Michaels
C
9

Three SIMPLE steps to achieve this without editing keybindings.json

Step 1: Open keyboard shortcuts (ctrl + k ctrl + s)
Step 2: Type list.find inside the search bar.
Step 3: Change key-binding to f3. If there are multiple bindings f3 and ctrl+f, remove ctrl+f key-binding.

You can also open keyboard shortcuts by: Opening the palette ctrl + shift + p, type open keyboard shortcuts.

Chericheria answered 8/12, 2022 at 7:18 Comment(0)
M
0

When I click on a file and then press Ctrl+F, I immediately start typing the value I'm looking for.

You could look at this from two angles.

  • Some people think clicking a file in the Explorer should move focus to the editor area. For that, see How to focus editor after clicking file in the VS Code Explorer View?.

  • That aside, for the issue of ctrl+f in Explorer, Microsoft has recognized that as a common paper-cut, and made a change in version 1.89 that changes the default keybinding for the list.find command to ctrl+alt+f on Windows and Linux, and to cmd+opt+f on macOS. Related source code is here. Pull Request is #210634. You can also make manual changes to keybindings of list.find.

Munger answered 3/5 at 3:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.