一、安装插件
二、Github 地址
https://github.com/OBKoro1/koro1FileHeader
三、快速上手
https://github.com/OBKoro1/koro1FileHeader/wiki/%E5%AE%89%E8%A3%85%E5%92%8C%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B
四、详细配置
https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
五、快捷键
1、添加文件头 Ctrl+Win+i
2、添加函数头 Ctrl+Win+t
六、简单模板(settings.json)
{
"workbench.colorTheme": "Default Dark+",
"idf.gitPathWin": "\\Git\\cmd\\git.exe",
"idf.espIdfPathWin": "e:\\idf5.0Release\\esp-idf",
"idf.pythonBinPathWin": "C:\\Users\\magene\\.espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe",
"idf.toolsPathWin": "C:\\Users\\magene\\.espressif",
"idf.customExtraPaths": "C:\\Users\\magene\\.espressif\\tools\\xtensa-esp-elf-gdb\\11.2_20220808\\xtensa-esp-elf-gdb\\bin;C:\\Users\\magene\\.espressif\\tools\\riscv32-esp-elf-gdb\\11.2_20220808\\riscv32-esp-elf-gdb\\bin;C:\\Users\\magene\\.espressif\\tools\\xtensa-esp32-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32-elf\\bin;C:\\Users\\magene\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32s2-elf\\bin;C:\\Users\\magene\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2022r1-RC1-11.2.0\\xtensa-esp32s3-elf\\bin;C:\\Users\\magene\\.espressif\\tools\\riscv32-esp-elf\\esp-2022r1-RC1-11.2.0\\riscv32-esp-elf\\bin;C:\\Users\\magene\\.espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Users\\magene\\.espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Users\\magene\\.espressif\\tools\\cmake\\3.23.1\\bin;C:\\Users\\magene\\.espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20220706\\openocd-esp32\\bin;C:\\Users\\magene\\.espressif\\tools\\ninja\\1.10.2;C:\\Users\\magene\\.espressif\\tools\\idf-exe\\1.0.3;C:\\Users\\magene\\.espressif\\tools\\ccache\\4.3\\ccache-4.3-windows-64;C:\\Users\\magene\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
"idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Users\\\\magene\\\\.espressif\\\\tools\\\\openocd-esp32\\\\v0.11.0-esp32-20220706/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
"workbench.colorCustomizations": {
"editor.selectionBackground": "#f5f232",
"editor.findMatchBackground": "#f5f232",
},
// 头部注释
"fileheader.customMade": {
"Date": "Do not edit", // 文件创建时间(不变)
"Description": "", // 介绍文件的作用、文件的入参、出参。
// custom_string_obkoro1~custom_string_obkoro100都可以输出自定义信息
// 可以设置多条自定义信息 设置个性签名、留下QQ、微信联系方式、输入空行等
"custom_string_obkoro1": "",
// 版权声明 保留文件所有权利 自动替换年份 获取git配置的用户名和邮箱
// 版权声明获取git配置, 与Author字段一致: ${git_name} ${git_email} ${git_name_email}
"custom_string_obkoro1_copyright": "Copyright (c) ${now_year} by ${git_name_email}, All Rights Reserved. "
// "custom_string_obkoro1_copyright": "Copyright (c) ${now_year} by 写死的公司名/用户名, All Rights Reserved. "
},
// 函数注释
"fileheader.cursorMode": {
"custom_string_obkoro1":"",
"custom_string_obkoro2":"",
"param": "", // param 开启函数参数自动提取 需要将光标放在函数行或者函数上方的空白行
"return": "",
},
"fileheader.configObj": {
"createFileTime": true,
"language": {
"languagetest": {
"head": "/$$",
"middle": " $ @",
"end": " $/",
"functionSymbol": {
"head": "/** ",
"middle": " * @",
"end": " */"
},
"functionParams": "c"
}
},
"autoAdd": false,
"autoAddLine": 100,
"autoAlready": true,
"annotationStr": {
"head": "/*",
"middle": " * @",
"end": " */",
"use": false
},
"headInsertLine": {
"php": 2,
"sh": 2
},
"beforeAnnotation": {
"文件后缀": "该文件后缀的头部注释之前添加某些内容"
},
"afterAnnotation": {
"文件后缀": "该文件后缀的头部注释之后添加某些内容"
},
"specialOptions": {
"特殊字段": "自定义比如LastEditTime/LastEditors"
},
"switch": {
"newlineAddAnnotation": true
},
"supportAutoLanguage": [],
"prohibitAutoAdd": [
"json"
],
"folderBlacklist": [
"node_modules",
"文件夹禁止自动添加头部注释"
],
"prohibitItemAutoAdd": [
"项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
],
"moveCursor": true,
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"atSymbol": [
"@",
"@"
],
"atSymbolObj": {
"文件后缀": [
"头部注释@符号",
"函数注释@符号"
]
},
"colon": [
": ",
": "
],
"colonObj": {
"文件后缀": [
"头部注释冒号",
"函数注释冒号"
]
},
"filePathColon": "路径分隔符替换",
"showErrorMessage": false,
"writeLog": false,
"wideSame": true,
"wideNum": 13,
"functionWideNum": 6,
"CheckFileChange": false,
"createHeader": false,
"useWorker": false,
"designAddHead": false,
"headDesignName": "random",
"headDesign": false,
"cursorModeInternalAll": {},
"openFunctionParamsCheck": true,
//"functionParamsShape": "no type",
"functionParamsShape": ["{", "}"],
"functionBlankSpaceAll": {},
"functionTypeSymbol": "void",
"typeParamOrder": "type param",
"customHasHeadEnd": {},
"throttleTime": 60000,
"functionParamAddStr": ": ",
"NoMatchParams": "show param"
}
}