Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable search selection in Visual Studio

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.

like image 822
Anders Rune Jensen Avatar asked Nov 28 '12 19:11

Anders Rune Jensen


People also ask

How to search function in Visual Studio?

Visual Studio 17.2 Preview 3 introduces a brand-new All-In-One search experience that merges the existing VS Search (Ctrl + Q) and Go To (Ctrl + T) to allow you to search both your code and Visual Studio features quicker and easier than ever, all in the same place.

How to search in Visual Studio 2022?

To enable the new search experience, go to Tools > Options > Environment > Preview Features > New Visual Studio Search Experience. We would love to get your feedback on the new search experience so please give it a try and let us know what you think!

How to search code in Visual Studio?

VS Code allows you to quickly search over all files in the currently opened folder. Press Ctrl+Shift+F and enter your search term. Search results are grouped into files containing the search term, with an indication of the hits in each file and its location.


1 Answers

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"

like image 199
Eske Rahn Avatar answered Oct 21 '22 01:10

Eske Rahn