一、安裝插件
二、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"
}
}