13

Using Microsoft's Visual Studio Code, how do I show only certain files and file patterns in the sidebar and exclude all other files?

I want to show .yml files to achieve editing only them and not to scroll through all files.

I tried this, but it didn't work.

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

P.S. I understand there is a way to hide certain files, but I want to show only specific files. I don't mind using an extension to achieve this.

2

1 Answer 1

5

This will get you pretty close:

"files.exclude": {

    "**/*.[^y]*": true,
    "**/*.y[^m]*": true,
    "**/*.ym[^l]*": true
}

It should exclude all files except those starting with a .ym(etc.) extension, like .yml, .ym, .ymabcdef, etc. I don't know if you have any other files besides .yml that match that pattern. I think right now this is as close as you can get to what you want. The last entry doesn't seem to actually do anything though it should!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.