Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015-2019: How do I bring back the old find dialog from VS 2010?

I find the new "quick find" dialog hard to use:

  1. It's difficult to see whether "Match case" or "Match whole word" are selected, especially when the editor is in focus.
  2. I find "Aa" harder to comprehend than "Match case", and "Ab" harder to comprehend than "Match whole word".
  3. The keyboard shortcuts to select Match case/whole word are only visible in the tooltip.
  4. The dialog is no longer moveable.

I know about remapping "Find in Files" to Ctrl+F, but then there are too many clicks to search the current document vs all files.

like image 632
Jon Avatar asked Mar 06 '14 03:03

Jon


People also ask

How do I undo Ctrl KC?

To reverse your last Undo, press CTRL+Y.

How do I enable shortcut keys in Visual Studio?

On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.

What is the shortcut key for switching between the open tab in Visual Studio?

When using Visual Studio Code on Windows, you can use CTRL + PAGE_UP to switch to the previous tab, and CTRL + PAGE_DN to switch to the next tab. You also have the ability to switch to tabs based on their (non-zero relative) index. You can do so, by pressing and holding ALT , followed by a number (1 through 9).


2 Answers

Its the same shortcut, CTRL+SHIFT+F However, seems like it is changed a lot.

  1. By default, it will show "ALL" results in a new window
  2. You have click on Find "Find Next" to find within open document.

I am also used to use that old dialog. I am not feeling comfortable with this new dialog. Wish I could bring back that old dialog somehow.

thanks Sameers

like image 71
Sameers Javed Avatar answered Sep 23 '22 23:09

Sameers Javed


There doesn't seem to be a way to accomplish this in Visual Studio per se, however if you install AutoHotkey, you can simulate similar behaviour to VS2010 (also a favourite version of mine).

The AHK script I made for myself is here: pastebin.com/M0fVTzLr

It assumes you have CTRL-SHIFT-F and CTRL-F mapped to "Find in Files". So when you hit CTRL-F, for example, "Find in Files" dialog appears, and the AHK script sets the "Look In" to "Current Document". Also, when you press ENTER, it doesn't do a "Find All" but does a "Find Next". To perform a real "Find All", you'll have to hit ALT-A.

In addition, I made SHIFT-ENTER perform a "Find Previous".

So basically, with this AHK script, you just hit CTRL-F, type your text to find, the hit ENTER to find it, and SHIFT-ENTER to find previous.

If you wish to simulate the behaviour of closing the Find in Files dialog after you hit ENTER and it does the first find, then change the line:

Enter::SendInput !f

to:

Enter::
  SendInput !f
  Wait 100
  SendInput {esc}
  Return

Note: It will always set the "Look In" box to "Current Document", even if you have text selected. However, you could always set up another hotkey, such as CTRL-ALT-F, to do the same as above but set the "Look In" box to "Selected Text". As CTRL-F forces it back to "Current Document", you don't have to worry about what the default will always be. :)

like image 36
ingredient_15939 Avatar answered Sep 23 '22 23:09

ingredient_15939