Is there any way to use Visual Studio's Find and Replace to search only through files of a specified type or types?
If I'm searching through my web project for a particular string, it winds up looking through all my javascript, css and html files when I know all that I'm interested in is results that are in .cs files, for example.
I find myself using Notepad++ which does have the ability to limit its "Find In Files" search to only the file types I specify within the directory I specify, but would love an integrated solution.
Search by file type You can use the filetype: operator in Google Search to limit results to a specific file type. For example, filetype:rtf galway will search for RTF files with the term "galway" in them.
Click the File Search on the status bar on the bottom of the VSCode IDE. You can also use a keyboard shortcut, Control+Shift+P in Windows or Command+Shift+P on MacOS, to open the command palette and choose Now: Global Search from the list.
In version after VScode 1.70 (July 2022) all you need to do is press Ctrl+F or F3 to search.
You can choose file types from default or type your own. Regular expressions available for complex search.
In the Find Options, you can specify the settings under "Look at these file types:"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With