简体   繁体   English

如何在 Visual Studio Code 的资源管理器中临时过滤掉所有不以 .sh 结尾的文件

[英]How to temporarily filter out all files that don’t end by .sh in Visual Studio Code’s explorer

I would like to temporarily filter out all files that don't end by .sh in Visual Studio Code's explorer.我想在 Visual Studio Code 的资源管理器中暂时过滤掉所有不以.sh结尾的文件。

Is that possible?那可能吗? Trying to find an easy way to audit all shell scripts.试图找到一种简单的方法来审核所有 shell 脚本。

Thanks!谢谢!

This is a more permanent solution:这是一个更永久的解决方案:

"files.exclude": {
  "**/node_modules": true,
    "**/*.[^s]*": true,
    "**/*.s[^h]*": true,
},

setting seems to work.设置似乎工作。 You will still get folders but the only files will be .sh extensions.您仍将获得文件夹,但唯一的文件将是.sh扩展名。


Alternatively, you can filter the Explorer files by, when focus is in the Explorer, typing .sh .或者,当焦点位于资源管理器中时,您可以通过键入.sh来过滤资源管理器文件。 When you are done, hover over the little highlighted .sh in the upper right corner of the Explorer view and select Clear to return to normal.完成后,hover 在资源管理器视图右上角突出显示的小.sh和 select Clear即可恢复正常。

You will get only .sh* files this way, so if you extensions of .sh2 or a filename like abcd.shabc.txt they would also appear but I assume this will get you where you want to go.这样你只会得到.sh*文件,所以如果你的扩展名是.sh2或像abcd.shabc.txt这样的文件名,它们也会出现,但我认为这会让你到达你想要的 go。

with Workbench > List: Keyboard Navigation set to filter .使用Workbench > List: Keyboard Navigation设置为filter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM