设置VsCode搜索时排除文件,文件列表中隐藏文件

按照《VsCode + gdb + gdbserver远程调试C++程序》中介绍的方法,配置好VsCode后,打开一个C/C++工程,发现左侧的面板会显示编译时生成的中间文件(比如.d和.o文件)。我们可以通过设置隐藏掉一些我们不需要打开的文件以简洁面板:

编辑.vscode子目录下的settings.json中的search.exclude配置可以实现搜索时排除文件,编辑files.exclude配置可以实现文件列表中隐藏文件。以下面的settings.json为例,下面设置表示隐藏和搜索时排除后缀名为.0,.d,.a,.pc,.so的文件:

bash 复制代码
{
    "files.associations": {
        "random": "c",
        "ratio": "c",
        "sstream": "c"
    }
    "search.exclude": {
        "**/*.o"           :true,
        "**/*.d"         :true,
        "**/*.a"           :true,
        "**/*.pc"           :true,
        "**/*.so"         :true
    }
    "files.exclude": {
        "**/*.o"           :true,
        "**/*.d"         :true,
        "**/*.a"           :true,
        "**/*.pc"           :true,
        "**/*.so"         :true
    }
}

修改完settings.json后,重新打开VsCode,会发现设置已生效。

相关推荐
罗政6 小时前
冒险岛079 V8 整合版源码搭建教程+IDEA启动
java·ide·intellij-idea
艾斯比的日常8 小时前
VSCode 实用快捷键
ide·vscode·编辑器
Galaxy_12298 小时前
vscode远程报错:Remote host key has changed,...
ide·vscode·编辑器
彬sir哥8 小时前
VScode运行后出现黑窗口
vscode·运行·黑窗口
Hi~晴天大圣13 小时前
Pycharm中断点使用技巧
ide·python·pycharm
且随疾风前行.14 小时前
Android Studio 提示 !Failed to initialize editor
android·ide·android studio
比牛顿更懂PID15 小时前
VSCode本地python包“无法解析导入”
ide·vscode·python
qxyywy17 小时前
CUDA 安装 一直卡在Installing Nsight Visual Studio Edition
ide·visual studio·cuda
前端郭德纲18 小时前
vscode默认终端怎么设置成git bash
git·vscode·bash
瞌睡不来19 小时前
(学习总结25)Linux工具:vim 编辑器 和 gcc/g++ 编译器
linux·学习·编辑器·vim·编译器·gcc/g++