1

Is there a way to search for a text in only CPP and header files in a directory using VS Code?

I.e., if I press "Ctrl+Shift+F" and search for a text, it will search in all the files including README and other files also in the current directory and return the files that matched. Basically I want to search for a text only in C++ (.cpp) and header (.h) files.

There is a similar question - "VS Code - Search for text in all files in a directory". It does not help because it will search in all files ignoring the extension of the files.

coderbhai
  • 41
  • 9

1 Answers1

5

You can open the file filter with the ellipsis, and seperate file extensions to filter with a comma:

enter image description here

This will search only .cpp and .h files.

Cr4xy
  • 179
  • 1
  • 8