如何在 Visual Studio Code 的侧栏中排除除某些文件之外的所有文件? [英] How to exclude all but certain files in the sidebar in Visual Studio Code?

查看:69
本文介绍了如何在 Visual Studio Code 的侧栏中排除除某些文件之外的所有文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Microsoft 的 Visual Studio Code,如何在侧边栏中仅显示某些文件和文件模式并排除所有其他文件?

我想显示 .yml 文件以实现仅编辑它们而不是滚动浏览所有文件.

我试过了,但没有用.

<前>"files.exclude": {**/*: 真的,**/*.yml":假}

附言我知道有一种方法可以隐藏某些文件,但我只想显示特定文件.我不介意使用扩展来实现这一点.

解决方案

这会让你非常接近:

"files.exclude": {"**/*.[^y]*": 真,"**/*.y[^m]*": 真,"**/*.ym[^l]*": 真}

它应该排除所有文件除了那些以 .ym(etc.) 扩展名开头的文件,例如 .yml、.ym、.ymabcdef 等.我不知道您是否还有其他文件除了 .yml 匹配该模式的文件.我认为现在这是最接近你想要的.最后一个条目似乎实际上并没有做任何事情,尽管它应该!!

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.

解决方案

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

这篇关于如何在 Visual Studio Code 的侧栏中排除除某些文件之外的所有文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆