Is there a way to search for text in all files in a directory using VS Code?
I.e., if I type \"find this\" in my search, it will search through all the files in the
A simple answer is to click the magnifying glass on the left side bar
Ctrl + P (Win, Linux), Cmd + P (Mac) – Quick open, Go to file
I think these official guide should work for your case.
VS Code allows you to quickly search over all files in the currently-opened folder. Press Ctrl+Shift+F and enter in 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. Expand a file to see a preview of all of the hits within that file. Then single-click on one of the hits to view it in the editor.
If you have a directory open in VSCode, and want to search a subdirectory, then either:
files to include
field enter the path with a leading ./
,or
Find in Folder...
option.To add to the above, if you want to search within the selected folder, right click on the folder and click "Find in Folder" or default key binding:
Alt+Shift+F
As already mentioned, to search all folders in your project, click Edit > "Find in Files" or:
Ctrl+Shift+F
You can do Edit, Find in Files (or Ctrl+Shift+F - default key binding, Cmd+Shift+F on MacOS) to search the Currently open Folder.
There is an ellipsis on the dialog where you can include/exclude files, and options in the search box for matching case/word and using Regex.