In Visual Studio code, how do I search for just a specific file type (i.e. *.css
or *.ts
)?
PS: I'm talking about the global search (Ctrl+Shift+F in Windows)
I'm already using the "files to include" as a folder filter. So currently it has something like ./src/app
.
Search across files# 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.
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.
Click the ellipses on the bottom right to display the "files to include" field.
You can specify a particular type with "*.filetype".
E.g.
You can do this.
./src/app/**/*.ts
other glob syntax
*
to match one or more characters in a path segment?
to match on one character in a path segment**
to match any number of path segments, including none{}
to group conditions (for example {**/*.html,**/*.txt} matches all HTML and text files)[]
to declare a range of characters to match (example.[0-9] to match on example.0, example.1, …)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