前言
本來之前也安裝過一個頭部文件注釋的插件:vscode-fileheader
,由于插件的注釋模板都是定死的,想要自己定制一些模板注釋也不行,實在用的不舒服,然后自己去研究了一番,參考vscode-fileheader
插件的一些內容,開發了這個插件。
koroFileHeader
在 VsCode 中通過快捷鍵ctrl+alt+i
在文件頭部添加注釋。
language
English | 簡體中文
簡介
- vscode擴展插件
- 在文件頭中添加注釋
- 支持用戶自定義文件注釋模板對象
- 在你保存文件的時候 自動更新編輯時間
安裝
在 Vscode 擴展商店中搜索 koroFileHeader
使用
- 在 Vscode 中打開文件
- 按
ctrl+alt+i
成功在文件頭部插入文件注釋
注釋模板
默認注釋模板
-
默認配置:
"fileheader.customMade": { "Author": "OBKoro1", "Date": "Do not edit", "LastEditors": "OBKoro1", "LastEditTime": "Do not edit", "Description": "", }
-
文件注釋生成:
/* * @Author:OBKoro1 * @Date:2018-05-15 16:20:04 * @LastEditors:OBKoro1 * @LastEditTime:2018-05-15 16:20:04 * @Description: */
推薦模板參數
Email
、Company
、version
等.
自定義注釋模板
- 在 VsCode 設置中搜索
fileheader.customMade
- 復制默認配置+修改配置
- 重啟 VsCode 生效
Example
- 設置:
image
-
文件注釋生成:
/* * @Author: OBKoro1 * @Date: 2018-05-16 12:33:57 * @LastEditors: OBKoro1 * @LastEditTime: 2018-05-16 12:33:57 * @Description: * @Email: your Email * @Company: your company * @youWant: add you want */
自動更新編輯時間 示例:
image
作者:OBKoro1
鏈接:https://www.imooc.com/article/29921
來源:慕課網