VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

10-11 229阅读 0评论

?=1. VSCode 工程创建

先在 Ubuntu编译一下 uboot,然后将编译后的 uboot 文件夹复制到 Windows 下,并创建vscode 工程。打开 VScode选择文件->打开文件夹…,选中 uboot 文件夹,如图所示:

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

点击“文件->将工作区另存为…”,打开保存工作区对话框,将工作区保存到 uboot 源码根目录下,设置文件名为“uboot”

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

2. 使用步骤

保存成功以后就会在 uboot 源码根目录下存在一个名为 uboot.code-workspace 的文件。这样一个完整的 VSCode 工程就建立起来了。但是这个 vsCode 工程含了 uboot 的所有文件, uboot中有些文件是不需要的,比如 arch 目录下是各种架构的文件夹,

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

在 arch 目录下,我们只需要 arm 文件夹,所以需要将其它的目录从 VSCode 中给屏蔽掉,比如将 arch/aVR32 这个目录给屏蔽掉。在 VSCode 上建名为“.vscode”的文件夹,

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

在.vscode 文件夹中新建一个名为“settings.JSon”的文件,然后在 settings.json 中输入如下内容:

{ "search.exclude": { "**/*.o":true, "**/*.su":true, "**/*.cmd":true, "arch/arc":true, "arch/avr32":true, "arch/blackfin":true, "arch/m68k":true, "arch/microblaze":true, "arch/mips":true, "arch/nds32":true, "arch/nios2":true, "arch/openrisc":true, "arch/powerpc":true, "arch/sandbox":true, "arch/sh":true, "arch/sparc":true, "arch/x86":true, "arch/arm/mach*":true, "arch/arm/cpu/arm11*":true, "arch/arm/cpu/arm720t":true, "arch/arm/cpu/arm9*":true, "arch/arm/cpu/armv7m":true, "arch/arm/cpu/armv8":true, "arch/arm/cpu/pxa":true, "arch/arm/cpu/sa1100":true, "board/[a-e]*":true, "board/[g-z]*":true, "board/[0-9]*":true, "board/[A-Z]*":true, "board/fir*":true, "board/freescale/b*":true, "board/freescale/l*":true, "board/freescale/m5*":true, "board/freescale/mp*":true, "board/freescale/c29*":true, "board/freescale/cor*":true, "board/freescale/mx7*":true, "board/freescale/mx2*":true, "board/freescale/mx3*":true, "board/freescale/mx5*":true, "board/freescale/p*":true, "board/freescale/q*":true, "board/freescale/t*":true, "board/freescale/v*":true, "configs/[a-l]*":true, "configs/[n-z]*":true, "configs/[A-Z]*":true, "configs/M[a-z]*":true, "configs/M[A-Z]*":true, "configs/M[0-9]*":true, "configs/m[a-w]*":true, "configs/m[0-9]*":true, "configs/[0-9]*":true, "include/configs/[a-l]*":true, "include/configs/[n-z]*":true, "include/configs/[A-Z]*":true, "include/configs/m[a-w]*":true, }, "files.exclude": { "**/*.o":true, "**/*.su":true, "**/*.cmd":true, "arch/arc":true, "arch/avr32":true, "arch/blackfin":true, "arch/m68k":true, "arch/microblaze":true, "arch/mips":true, "arch/nds32":true, "arch/nios2":true, "arch/openrisc":true, "arch/powerpc":true, "arch/sandbox":true, "arch/sh":true, "arch/sparc":true, "arch/x86":true, "arch/arm/mach*":true, "arch/arm/cpu/arm11*":true, "arch/arm/cpu/arm720t":true, "arch/arm/cpu/arm9*":true, "arch/arm/cpu/armv7m":true, "arch/arm/cpu/armv8":true, "arch/arm/cpu/pxa":true, "arch/arm/cpu/sa1100":true, "board/[a-e]*":true, "board/[g-z]*":true, "board/[0-9]*":true, "board/[A-Z]*":true, "board/fir*":true, "board/freescale/b*":true, "board/freescale/l*":true, "board/freescale/m5*":true, "board/freescale/mp*":true, "board/freescale/c29*":true, "board/freescale/cor*":true, "board/freescale/mx7*":true, "board/freescale/mx2*":true, "board/freescale/mx3*":true, "board/freescale/mx5*":true, "board/freescale/p*":true, "board/freescale/q*":true, "board/freescale/t*":true, "board/freescale/v*":true, "configs/[a-l]*":true, "configs/[n-z]*":true, "configs/[A-Z]*":true, "configs/M[a-z]*":true, "configs/M[A-Z]*":true, "configs/M[0-9]*":true, "configs/m[a-w]*":true, "configs/m[0-9]*":true, "configs/[0-9]*":true, "include/configs/[a-l]*":true, "include/configs/[n-z]*":true, "include/configs/[A-Z]*":true, "include/configs/m[a-w]*":true, }    }

其中"search.exclude"里面是需要在搜索结果中排除的文件或者文件夹, "files.exclude"是左侧工程目录中需要排除的文件或者文件夹。我们需要将 在arc文件夹中除了 arm 以及board文件夹中除了freescale 文件夹下的所有文件从搜索结果和左侧的工程目录中都排除掉,因此在 "search.exclude"和"files.exclude"中输入如图

VScode 隐藏大量无用的文件比如在看Linux kernel或boot时候

上述代码用到了通配符“”,比如“**/.o”表示所有.o 结尾的文件。“configs/[a-l]*”表示 configs 目录下所有以‘a’ ~‘l’开头的文件或者文件夹。 上述配置只是排除了一部分文件夹,大家在实际的使用中可以根据自己的实际需求来选择将哪些文件或者文件夹排除掉。排除以后我们的工程就会清爽很多,搜索的时候也不会跳出很多文件了。

3. 在Linux kernel中,要忽略掉的内容

{ "search.exclude": { "**/node_modules": true, "**/bower_componenTS": true, "**/*.o":true, "**/*.su":true,  "**/*.cmd":true, "DocumentatiON":true,   /* 屏蔽不用的架构相关的文件 */ "arch/alpha":true, "arch/arc":true, "arch/arm64":true, "arch/avr32":true, "arch/[b-z]*":true, "arch/arm/plat*":true,    "arch/arm/mach-[a-h]*":true,    "arch/arm/mach-[n-z]*":true,   "arch/arm/mach-i[n-z]*":true,  "arch/arm/mach-m[e-v]*":true,  "arch/arm/mach-k*":true,  "arch/arm/mach-l*":true,   /* 屏蔽排除不用的配置文件 */ "arch/arm/configs/[a-h]*":true,  "arch/arm/configs/[j-z]*":true,  "arch/arm/configs/imo*":true,  "arch/arm/configs/in*":true,  "arch/arm/configs/io*":true,  "arch/arm/configs/ix*":true,   /* 屏蔽掉不用的DTB文件 */ "arch/arm/boot/dts/[a-h]*":true,  "arch/arm/boot/dts/[k-z]*":true,  "arch/arm/boot/dts/in*":true,  "arch/arm/boot/dts/imx1*":true,  "arch/arm/boot/dts/imx7*":true,  "arch/arm/boot/dts/imx2*":true,  "arch/arm/boot/dts/imx3*":true,  "arch/arm/boot/dts/imx5*":true,  "arch/arm/boot/dts/imx6d*":true,  "arch/arm/boot/dts/imx6q*":true,  "arch/arm/boot/dts/imx6s*":true,  "arch/arm/boot/dts/imx6ull-9x9*":true,  "arch/arm/boot/dts/imx6ull-14x14-ddr*":true,  "arch/arm/boot/dts/*.tmp":true,    }, "files.exclude": { "**/.git": true, "**/.svn": true, "**/.hg": true, "**/CVS": true, "**/.DS_Store": true,   "**/*.o":true, "**/*.su":true,  "**/*.cmd":true, "Documentation":true,   /* 屏蔽不用的架构相关的文件 */ "arch/alpha":true, "arch/arc":true, "arch/arm64":true, "arch/avr32":true, "arch/[b-z]*":true, "arch/arm/plat*":true,    "arch/arm/mach-[a-h]*":true,    "arch/arm/mach-[n-z]*":true,   "arch/arm/mach-i[n-z]*":true,  "arch/arm/mach-m[e-v]*":true,  "arch/arm/mach-k*":true,  "arch/arm/mach-l*":true,   /* 屏蔽排除不用的配置文件 */ "arch/arm/configs/[a-h]*":true,  "arch/arm/configs/[j-z]*":true,  "arch/arm/configs/imo*":true,  "arch/arm/configs/in*":true,  "arch/arm/configs/io*":true,  "arch/arm/configs/ix*":true,   /* 屏蔽掉不用的DTB文件 */ "arch/arm/boot/dts/[a-h]*":true,  "arch/arm/boot/dts/[k-z]*":true,  "arch/arm/boot/dts/in*":true,  "arch/arm/boot/dts/imx1*":true,  "arch/arm/boot/dts/imx7*":true,  "arch/arm/boot/dts/imx2*":true,  "arch/arm/boot/dts/imx3*":true,  "arch/arm/boot/dts/imx5*":true,  "arch/arm/boot/dts/imx6d*":true,  "arch/arm/boot/dts/imx6q*":true,  "arch/arm/boot/dts/imx6s*":true,  "arch/arm/boot/dts/imx6ull-9x9*":true,  "arch/arm/boot/dts/imx6ull-14x14-ddr*":true,  "arch/arm/boot/dts/*.tmp":true,  }, "files.associations": { "kernel.h": "c", "fs.h": "c", "list.h": "c", "init.h": "c", "i2c.h": "c", "uaccess.h": "c", "i2c-dev.h": "c", "module.h": "c", "slab.h": "c" }, } 

到此这篇关于VScode隐藏大量无用的文件比如在看linuxkernel或boot时候的文章就介绍到这了,更多相关VScode隐藏无用文件内容请搜索云初冀北以前的文章或继续浏览下面的相关文章希望大家以后多多支持云初冀北!

免责声明
本站提供的资源,都来自网络,版权争议与本站无关,所有内容及软件的文章仅限用于学习和研究目的。不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负,我们不保证内容的长久可用性,通过使用本站内容随之而来的风险与本站无关,您必须在下载后的24个小时之内,从您的电脑/手机中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。侵删请致信E-mail:Goliszhou@gmail.com
$

发表评论

表情:
评论列表 (暂无评论,229人围观)

还没有评论,来说两句吧...