title: Visual Studio Code: Search Within Files but Exclude Folder
body: <p>In Visual Studio Code (not to be confused with Visual Studio) there is a search interface (click the mag glass at top left). </p>
  
  <p>It has a "files to include" field, and a "files to exclude" field.</p>
  
  <p>I know that I can include or exclude a <strong>file</strong> from my search by entering the name of the file, or using a wildcard like *.js.</p>
  
  <p>Is there a way to specifically include or exclude a <strong>directory</strong> by using these fields? If not, how would I do that?</p>
  
  <p>Edit:
  Some have said that this question may be similar to <a href="https://stackoverflow.com/questions/29971600/how-can-i-choose-folders-to-be-ignored-during-search">How can I choose folders to be ignored during search?</a></p>
  
  <p>I think it is fundamentally the same question, but as I said in a recent comment on that question: 
  "There is nothing in the title of this question to indicate that you are asking a question about a specific tool (Visual Studio Code). And while you do have it tagged <code>visual-studio-code</code> - making it appear in searches about that tool - the searcher will not necessarily know that this question is about VS Code. Also, you use a Mac specific keyboard command that is not really relevant to the question at hand, and makes the question seem non-relevant to non-Mac users."</p>
  
  <p>So, yes, I guess it's the same question. But I don't think it's reasonable to expect me to have found it.</p>