【问题标题】:VS Code: Excluding files with same name but different ExtensionVS Code:排除具有相同名称但扩展名不同的文件
【发布时间】:2019-11-24 21:40:22
【问题描述】:

我有一个关于 VS Code 中的文件排除功能的问题。 目前我在 VSC 中使用 LaTex,我希望代码忽略文件资源管理器中显示的大多数 master.* 文件,当然 master.tex 和 master.pdf 除外。

我尝试在 settings.json 中添加一些模式:

"files.exclude": {
    "master.tex": false,
    "master.*": true,   
    "*.lol": true
},

还有:

"files.exclude": {
    "master.*": true,
    "master.tex": false,   
    "*.lol": true
},

但这些不起作用,因为它们排除了所有 master.* 文件。我当然可以手动添加所有扩展,但我真的希望有一个更优雅的解决方案。

提前谢谢你:)

【问题讨论】:

  • @Alex 提出的问题在我看来不是重复的。排除模式不同,那里给出的答案不适用于这个问题。

标签: visual-studio-code


【解决方案1】:

没有Simple way 可以执行此操作,但此语法可以满足您的要求:

"files.exclude": {
    "master.[^tp]*": true, 
    "master.[^tp][^ed]*": true, 
    "master.[^tp][^ed][^xf]*": true, 
    "*.lol": true
},

【讨论】:

  • 非常感谢您的回答,它解决了问题! :)
猜你喜欢
  • 2017-04-03
  • 2021-11-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多