When searching, VS Code has the ability to list files to include to scope the search. This is used by default when using the "find in folder" feature. For example, searching src
results in ./src
as the files to include.
Is there a syntax I can use to list multiple directories here? For example, I want to search ./src
and ./lib
in one search.
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.
If you want to Add Selection To Next Find Match then use Ctrl + D . If you want to Move Last Selection To Next Find Match then use Ctrl + K + Ctrl + D .
Drag and drop# You can even select and drag multiple folders. Note: Dropping a single folder into the editor region of VS Code will still open the folder in single folder mode. If you drag and drop multiple folders into the editor region, a new multi-root workspace will be created.
From the search function, click the ellipsis to show the files to include and files to exclude text boxes. Enter any files and folder to exclude (separated by commas). From menu choose File ➡️ Preferences ➡️ Settings ➡️ User/Workspace Settings and filter default settings to search .
Did you try a comma like ./dir1, ./dir2
? For me it seems to work
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