Reputation: 2270
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.
Upvotes: 11
Views: 5310
Reputation: 180885
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!!
Upvotes: 4