Choose folders to be ignored during search in VS Code

前端 未结 16 947
既然无缘
既然无缘 2020-11-28 18:10

Right now when I use +O to search for files, the fuzzy matching appears to operate over all files in the current project. Unfortunately, this includes

相关标签:
16条回答
  • 2020-11-28 18:14

    Hi you need to find settings and add a new exclude pattern for history files

    0 讨论(0)
  • 2020-11-28 18:14

    I wanted to search for the term "Stripe" in all files except those within a plugin ("plugin" folder) or within the files ending in ".bak", ".bak2" or ".log" (this is within the wp-contents folder structure of a wordpress install).

    I just wanted to do this search one time and very quickly, so I didn't want to alter the search settings of my environment. Here's how I did it (note the double asteriks for the folder):

    • Search Term: Stripe
    • Include Files: {blank}
    • Exclude Files: *.bak*, *.log, **/plugins/**

    Here's what it looked like

    0 讨论(0)
  • 2020-11-28 18:15

    If you have multiple folders in your workspace, set up the search.exclude on each folder. There's a drop-down next to WORKSPACE SETTINGS.

    Folder Settings Tab

    0 讨论(0)
  • 2020-11-28 18:16

    I wanted to exclude 1 of the Workspace folders completely, but found this to be difficult, since regardless of the exclusion patterns, it always runs the search on each of the Workspace folders.

    In the end, the solution was to add ** to the Folder Settings search exclusion patterns.

    0 讨论(0)
  • 2020-11-28 18:19

    The short answer is to comma-separate the folders you want to ignore in "files to exclude".

    1. Start workspace wide search: CTRL+SHIFT+f
    2. Expand the global search with the three-dot button
    3. Enter your search term
    4. As an example, in the files to exclude-input field write babel,concat to exclude the folder "babel" and the folder "concat" in the search (make sure the exclude button is enabled).
    5. Press enter to get the results.
    0 讨论(0)
  • 2020-11-28 18:20

    Exclude all from subfolders works like this (version 2019)

    include

    ./db
    

    exclude

    ./db/*
    
    0 讨论(0)
提交回复
热议问题