Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding specific files from Visual Studio search

Is it possible to exclude certain files from search in Visual Studio.

For example jquery.js is almost always polluting my search results with half result coming from that file.

I know you can white-list specific types, but when I want to search in .js extension is there solution for that?

Vote here for feature: https://developercommunity.visualstudio.com/idea/405990/code-search-exclude-files-from-search.html?inRegister=true

like image 431
pajics Avatar asked May 03 '13 11:05

pajics


People also ask

How exclude Files from VS code search?

Persistent Exclusions From menu choose File ➡️ Preferences ➡️ Settings ➡️ User/Workspace Settings and filter default settings to search . You can modify the search. exclude setting (copy from default setting to your user or workspace settings). That will apply only to searches.

How do I see excluded Files in Visual Studio?

Right click one of the files and select " Exclude from project", and the file disappears from the project. 3. Click "Show All Files" button on top of Solution Explorer to show all files, but the excluded file is not shown at all.

How do I search for a specific file in Visual Studio?

Ctrl + Shift + T.


2 Answers

Altough it does not solve your problem it may help out a bit

Ctrl + Shift + F should trigger the Find and Replace window.

From there, click Result Options and select "Display file names only".

It won't have all the info you need but might make it easier to recognize the files.

like image 103
Wilson Alberto Avatar answered Sep 19 '22 07:09

Wilson Alberto


In Visual Studio 2019 they modernized the "find in files" feature, now you can exclude files, file extensions and directories using an exclamation mark before the items to be excluded in the "File types" textbox, like this:

*.*;!jquery.js

another example: !*\bin\*;!*\obj\*;!*\.*;!*.xml

More info: https://devblogs.microsoft.com/visualstudio/modernizing-find-in-files/

like image 33
rec Avatar answered Sep 17 '22 07:09

rec