How to exclude all but certain files in the sidebar in Visual Studio Code?

可紊 提交于 2021-02-08 01:50:32

问题


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.


回答1:


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!!



来源:https://stackoverflow.com/questions/52331983/how-to-exclude-all-but-certain-files-in-the-sidebar-in-visual-studio-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!