/ vs2013

"Find and Replace" as Default Search in Visual Studio 2013

Visual Studio 2013 provides two search boxes, similar in functionality but differing considerably in design.

The first one, accessible using Ctrl+F, is minimalist, pushed into the corner with all the controls packed together as tightly as possible.

2014-07-24 09_54_49-VisualStudio2013FindBox

The second, accessible using Ctrl+Shift+F, is a more “standard” one, with ample spacing and utilizing the familiar popup dialog box.

2014-07-24 13_04_21-VisualStudio2013FindReplaceBox

I imagine this is part of the ongoing effort to keep things “flattened” and maintain focus in the current screen (consider Peek Definition and the scrollbar’s Preview Tooltip).

But I no like. It’s awkward to use. The options are too close. The box is too small. I aim for the tiny drop-down arrow in the upper-right and either perform a premature search, or inadvertently close the @#$%! search box.

How to make the “Find in Files” tab of the classic “Find and Replace” popup the default

You can change the shortcuts for these search boxes, so the more traditional search box pops up with Ctrl+F.

  • Open up Tools / Options and select the Environment / Keyboard tab in the dialog box.
  • Type “find” in the “Show commands containing” dialog box to filter the commands in the list box.
  • You’ll see two options: - “Edit.Find” is the default, docked search box.
  • “Edit.FindinFiles” is the alternative search box, closer to the traditional search box.

2014-07-24 09_50_03-VisualStudio2013FindSettings

2014-07-24 09_50_43-VisualStudio2013FindReplaceSettings

Select “Edit.FindinFiles”, place the cursor in “Press shortcut keys:”, and press Ctrl+F. It’ll remind you that it’s in use by the other “Find” dialog. Don’t care! “Assign” that sucka.

2014-07-25 11_12_23-VisualStudio2013FindReplaceShortcutWarning

Since you can have multiple shortcuts for a single option, both shortcuts now open the “Find” dialog window. You can select “Edit.Find” and apply the other shortcut to it if you still want to be able to access it. Personally, I don’t.

2014-07-25 11_13_49-VisualStudio2013FindReplaceShortcuts

How to make the “Replace in Files” tab of the classic “Find and Replace” popup the default

But what if most of the searches you perform are for the purposes of replacing text, not just finding it?

The instructions above show you how to default to the “Find in Files” tab of the classic “Find and Replace” popup, but note the other tab – “Replace in Files”.

2014-07-24 13_04_21-VisualStudio2013FindReplaceBox

Instead of searching for “FindinFiles” in the keyboard settings, do a search for “ReplaceinFiles”. On my system, it’s assigned to “Ctrl+Shift+H” by default.

Following the same instructions as above, you can map it to “Ctrl+F”, and make the more classic search/replace dialog box the default.

replaceinfiles visualstudio

And, since keyboard settings are synchronized in VS2013 (if you’re logged in), this setting will be reflected in all environments on all your development machines (you’ll have to restart any current VS sessions to see the change).


Grant Winney

Grant Winney

I write when I've got something to share - a personal project, a solution to a difficult problem, or just an idea. We learn by doing and sharing. We've all got something to contribute.

Read More