misaligar
misaligar

Reputation: 325

How to search within specific files in VS Code?

There are several hundred files in the workspace and I would like to perform a search within specific files. For example,

Find "Hello world" in the files starting with these three letters "mkr*"

Is there a way to accomplish this kind of search in the VS Code?

Thanks.

Upvotes: 1

Views: 11568

Answers (2)

foxiris
foxiris

Reputation: 3388

Click '...' and it will shows file to include and files to exclude.

enter image description here

Upvotes: 2

jabacchetta
jabacchetta

Reputation: 50248

  1. Open search (Mac: command+shift+f, Windows/Linux: ctrl+shift+f).
  2. Toggle search details (Mac: command+shift+j, Windows/Linux: ctrl+shift+j).
  3. In the "search" input, enter the keywords. In this case, Hello world.
  4. In the "files to include" input, add the pattern. In this case, */mkr*.*.

Upvotes: 5

Related Questions