vscode 注釋功能
{ // 頭部注釋 "fileheader.customMade": { // Author字段是文件的創建者 可以在specialOptions中更改特殊屬性 // 公司項目和個人項目可以配置不同的用戶名與郵箱 搜索: gitconfig includeIf 比如: https://ayase.moe/2021/03/09/customized-git-config/ // 自動提取當前git config中的: 用戶名、郵箱 "Author": "yhy", // 同時獲取用戶名與郵箱 // "Author": "git config user.name", // 僅獲取用戶名 // "Author": "git config user.email", // 僅獲取郵箱 // "Author": "OBKoro1", // 寫死的固定值 不從git config中獲取 "Date": "Do not edit", // 文件創建時間(不變) // LastEditors、LastEditTime、FilePath將會自動更新 如果覺得時間更新的太頻繁可以使用throttleTime(默認為1分鐘)配置更改更新時間。 // "LastEditors": "git config user.name && git config user.email", // 文件最后編輯者 與Author字段一致 // 由于編輯文件就會變更最后編輯時間,多人協作中合并的時候會導致merge // 可以將時間顆粒度改為周、或者月,這樣沖突就減少很多。搜索變更時間格式: dateFormat // "LastEditTime": "Do not edit", // 文件最后編輯時間 // 輸出相對路徑,類似: /文件夾名稱/src/index.js "FilePath": "Do not edit", // 文件在項目中的相對路徑 自動更新 // 插件會自動將光標移動到Description選項中 方便輸入 Description字段可以在specialOptions更改 "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": { "description": "", // 函數注釋生成之后,光標移動到這里 "author": "yhy", "param": "", // param 開啟函數參數自動提取 需要將光標放在函數行或者函數上方的空白行 "return": "", }, "fileheader.configObj": { "createFileTime": true, "language": { "languagetest": { "head": "/$$", "middle": " $ @", "end": " $/", "functionSymbol": { "head": "/** ", "middle": " * @", "end": " */" }, "functionParams": "js" } }, "autoAdd": true, "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": false, "wideNum": 13, "functionWideNum": 0, "CheckFileChange": false, "createHeader": false, "useWorker": false, "designAddHead": false, "headDesignName": "random", "headDesign": false, "cursorModeInternalAll": {}, "openFunctionParamsCheck": true, "functionParamsShape": [ "{", "}" ], "functionBlankSpaceAll": {}, "functionTypeSymbol": "*", "typeParamOrder": "type param", "customHasHeadEnd": {}, "throttleTime": 60000, "functionParamAddStr": "", "NoMatchParams": "no show param" }, "editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?", "editor.snippetSuggestions": "top" }
安裝 koroFileHeader 插件,然后修改上面的配置
文件注釋:ctrl+win+i
函數注釋:ctrl+win+t
有時ctrl可以不用

浙公網安備 33010602011771號