39

Does anyone know if its possible to disable the search in "Selection" option when searching in Visual Studio?

I find the search selection really confusing and I never want to search in a selection. Ever! I often copy some code by selecting it first, and then I do a search for something to go and paste the code in, but Visual Studio then by default searches in the selected text, which is not what I want.

I'm interested in a solution that works in at least Visual Studio 2010 and 2012, but 2008 would also be nice.

2 Answers 2

43

It has (Finally!!!) been fixed with an option. Following the vote link from acarlon :

In Visual Studio 2015, you can prevent Visual Studio from automatically switching to search in Selection scope by unchecking the following tools-option:

Tools-Options-Environment-Find and Replace-Automatically limit search to selection

Great that the option is only on the automation . So in the (for me extremely rare) cases where the functionality could be handy it is still possible by explicitly selecting the scope "Selection"

ADD: As Lexikos points out in comment, the option of "Selection" is actually quite handy with "Replace", especially "Replace All"

6
  • 1
    I almost always want to limit search to the current selection (especially if it's multiple lines) when I'm using search-and-replace. Thanks for pointing out the option, so that I could turn it on.
    – Lexikos
    Apr 25, 2017 at 10:28
  • @Lexikos I so seldom use it, that I completely overlooked, that it could be really handy combined with "Replace ALL", I'll try to remember that, thanks.
    – Eske Rahn
    Apr 26, 2017 at 11:11
  • 2
    Note, I have observed updates to Visual Studio resetting this option on me. Oct 4, 2019 at 19:57
  • 1
    Next step: a better default :) Sep 8, 2021 at 11:12
  • 1
    Thanks, can't believe this is still the default option on vs2019 when it's not on vscode. Hopefully they changed it on vs2022
    – kitkatsim
    Jul 30, 2022 at 8:36
9

There is no option currently, but you can vote for the option to disable it here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.