设置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,会发现设置已生效。

相关推荐
zhangfeng113315 小时前
WebIDE 容器中 AtomCode 报 `ATOMCODE_SIG_STALE` 排查实录:一次由 8 小时时钟偏差引发的“悬案”
编辑器·ai编程·atomcode
witton16 小时前
MacOS中在目录或者文件右键菜单中添加“使用VSCode打开”
vscode·macos·文件·目录·服务·automator·右键菜单
wabil17 小时前
[AI-Talk] codx制作xmind文件技巧
ide·ai编程·myeclipse·xmind
大衛說1 天前
02 · 环境搭建:uv 包管理与现代 IDE
ide·uv
山峰哥1 天前
数据库工程与查询优化案例深度复盘‌
数据库·sql·oracle·编辑器·深度优先·宽度优先
cndes1 天前
安装Miniconda+Jupyter notebook
ide·python·jupyter
码上暴富2 天前
Cursor / VS Code 自定义文件颜色
前端·vscode
洛兮银儿2 天前
pycharm选中同一个词的标记颜色的修改
ide·python·pycharm
2601_962381582 天前
VSCode如何配置LlamaIndex RAG(检索增强生成)应用开发环境
vscode·开发环境·rag·llamaindex·检索增强生成
javgo.cn2 天前
Markweave:开源 Markdown-first WYSIWYG 编辑器
开源·编辑器