- 🐚作者简介:花神庙码农(专注于Linux、WLAN、TCP/IP、Python等技术方向)
- 🐳博客主页:花神庙码农 ,地址:https://blog.csdn.net/qxhgd
- 🌐系列专栏:善假于物
- 📰如觉得博主文章写的不错或对你有所帮助的话,还望大家三连支持一下呀!!! 👉关注?、点赞👍、收藏📂、评论。
- 如需转载请参考转载须知!!
- 在使用vscode的过程中,在搜索结果或工程目录中,总是有很多无用的文件。
- 比较典型的是kernel代码中的arch下有众多目录,但实际上用的仅是某个目录而已。还有类似git、svn的目录等。
- 比较简单粗暴的方式是删除无用的代码,但如果是直接看git下载下来的代码,删除会有问题。本文整理了一些优雅的处理方法。
"search.exclude"里面是需要在搜索结果中排除的文件或者文件夹,
"files.exclude"是左侧工程目录中需要排除的文件或者文件夹。
有两种操作方式;
一种是直接在从界面的设置进入,找到下面的位置,根据需要进行添加:
也可以找到对应的配置文件settings.json,直接修改。如Win10系统下,在下面目录:
C:\Users\Administrator\AppData\Roaming\Code\User\settings.json
{
"folders": [
{
"path": "code/src/kernel/linux/v4.15"
}
],
"settings": {
"search.exclude": {
"arch/alpha" :true,
"arch/arc" :true,
"arch/arm" :true,
"arch/blackfin" :true,
"arch/c6x" :true,
"arch/cris" :true,
"arch/frv" :true,
"arch/h8300" :true,
"arch/hexagon" :true,
"arch/ia64" :true,
"arch/m32r" :true,
"arch/metag" :true,
"arch/microblaze" :true,
"arch/mn10300" :true,
"arch/nios2" :true,
"arch/mips" :true,
"arch/openrisc" :true,
"arch/parisc" :true,
"arch/powerpc" :true,
"arch/s390" :true,
"arch/score" :true,
"arch/sh" :true,
"arch/sparc" :true,
"arch/tile" :true,
"arch/um" :true,
"arch/unicore32" :true,
"arch/x86" :true,
"arch/xtensa" :true,
},
"files.exclude": {
"arch/alpha" :true,
"arch/arc" :true,
"arch/arm" :true,
"arch/blackfin" :true,
"arch/c6x" :true,
"arch/cris" :true,
"arch/frv" :true,
"arch/h8300" :true,
"arch/hexagon" :true,
"arch/ia64" :true,
"arch/m32r" :true,
"arch/metag" :true,
"arch/microblaze" :true,
"arch/mn10300" :true,
"arch/nios2" :true,
"arch/mips" :true,
"arch/openrisc" :true,
"arch/parisc" :true,
"arch/powerpc" :true,
"arch/s390" :true,
"arch/score" :true,
"arch/sh" :true,
"arch/sparc" :true,
"arch/tile" :true,
"arch/um" :true,
"arch/unicore32" :true,
"arch/x86" :true,
"arch/xtensa" :true,
}
}
}
"board/[0-9]*" : true,
"board/[a-e]*" : true,
如本文对你有些许帮助,欢迎大佬支持我一下,您的支持是我持续创作的不竭动力
支持我的方式