coderbhai
coderbhai

Reputation: 41

VS Code - Search for text in all only c++ (.cpp) and header (.h) files in a directory

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.

Upvotes: 1

Views: 2963

Answers (1)

Cr4xy
Cr4xy

Reputation: 179

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.

Upvotes: 5

Related Questions