Skip to content

Exclude all files except for... #869

Closed

Description

The files exclude allows you to set true/false values, but it doesn't seem to take them completely into account.

For example, I would like to hide everything except for the scripts folder. You might then assume that this would do this:

{
    "files.exclude":
    {
        "**/*": true,
        "**/Scripts": false
    }
}

It does not do that, it just hides everything. In order to achieve this, you must list every file and directory except for the Scripts directory, and who knows how many directories there are and if a new directory/file gets added you then must edit the list to exclude those.

In the end, their should be a way to hide everything except for xxx.

Activity

  1. added
    feature-request
    on Dec 1, 2015
  2. plantain-00 commented on Dec 2, 2015

    @plantain-00

    The comments above the files.exclude says Configure glob patterns for excluding files and folders.. the glob can use ! to exclude files and folders(which is not implemented by vscode now). for example:

    {
        // Configure glob patterns for excluding files and folders.
        "files.exclude": {
            "*.js": true,
            "!gulpfile.js": true
        }
    }
  3. dhirschfeld commented on Dec 8, 2015

    @dhirschfeld

    Can an option be added to exclude everything in the .gitignore?

  4. bpasero commented on Dec 8, 2015

    @bpasero
    Contributor

    Using negated glob patterns with "!" is currently not supported.

  5. TheColorRed commented on Dec 8, 2015

    @TheColorRed
    Author

    .gitignore will only hide the items from a commit, not hide them within the Editor

  6. hellogavin commented on Dec 24, 2015

    @hellogavin

    It's grate!!!

  7. xfoxfu commented on Jan 30, 2016

    @xfoxfu

    👍 I also want negated glob patterns since I use Jakefile.js to describe Jake tasks for my TypeScript project.

  8. JAForbes commented on Feb 7, 2016

    @JAForbes

    👍 I need negated glob files as we store our many services in node_modules under the same repo. We hide node_modules because it slows down the editor, and clutters the workspace. But we have to use directory symlinks so we can edit the specific services in another folder.

    If we could exclude these folders from being ignored, we could remove the symlinks and significantly reduce the complexity of our project. (Another issue is, debugging node in a symlinked folder doesn't work in vscode, this would be solved by this feature also.)

  9. AdamAndersonFalafelSoftware commented on Mar 17, 2016

    @AdamAndersonFalafelSoftware

    Yes, we need negated glob exclusions. In Node, the built-in place to put application-wide modules is in a node_modules folder. You would want to be able to exclude node_modules except for your project's modules under e.g. node_modules/_local so that you can easily navigate to your own modules without also including all the imported ones.

    Edit: this glob already works for the scenario above:

    {
        "search.exclude": {
            "**/node_modules": false,
            "**/node_modules/!(.local)": true,
            "**/bower_components": true
        }
    }
  10. 222 remaining items

  11. Vindicatory commented on Jun 4, 2026

    @Vindicatory

    +1
    hoping my grandchildren will see it

  12. biscimus commented on Aug 5, 2026

    @biscimus

    +1

  13. andresmedina-ui commented on Sep 16, 2026

    @andresmedina-ui

    +1

  14. added a commit that references this issue on Oct 30, 2026
    f85fab9
  15. added
    unreleased
    insiders-released
    verification-needed
    and removed
    unreleased
    verification-needed
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestfile-explorerfile-globinsiders-releasedon-testplan

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions