VSCode自动注释插件设置

一、VS Code自动注释插件

koroFileHeader

安装插件koroFileHeader
添加头文件注释:快捷键:window:ctrl+alt+i,mac:ctrl+cmd+i, linux: ctrl+meta+i
添加函数注释: 快捷键:window:ctrl+alt+t,mac:ctrl+cmd+t,linux: ctrl+meta+t

二、插件配置

插件配置说明:https://github.com/OBKoro1/koro1FileHeader

个人修改后的配置:

{
    "editor.fontSize": 16,
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 100,
    "workbench.tree.indent": 25,
    "C_Cpp.updateChannel": "Insiders",
    "window.zoomLevel": 0,
    "http.proxySupport": "off",
    "markdown-preview-enhanced.HTML5EmbedUseLinkSyntax": true,
    "markdown-preview-enhanced.enableCriticMarkupSyntax": true,
    "markdown-preview-enhanced.enableExtendedTableSyntax": true,
    "markdown-preview-enhanced.enableHTML5Embed": true,
    "markdown-preview-enhanced.enableTypographer": true,
    "markdown-preview-enhanced.HTML5EmbedIsAllowedHttp": true,
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "code-runner.clearPreviousOutput": true,
    "code-runner.executorMap": {},
    "code-runner.executorMapByFileExtension": {},
    "files.encoding": "gbk",
    "fileheader.configObj": {
        "createFileTime": true,
        "language": {
            "c/cpp/h/hpp": {
                "head": "/*******************************************************************",
                "middle": " * @",
                "end": "*******************************************************************/"
            }
        },
        "autoAdd": false,
        "autoAddLine": 100,
        "autoAlready": true,
        "annotationStr": {
            "head": "/*",
            "middle": " * @",
            "end": " */",
            "use": false
        },
        "headInsertLine": {
            "php": 2,
            "*":1
        },
        "beforeAnnotation": {
            "文件后缀": "该文件后缀的头部注释之前添加某些内容"
        },
        "afterAnnotation": {
            "文件后缀": "该文件后缀的头部注释之后添加某些内容"
        },
        "specialOptions": {
            "特殊字段": "自定义比如LastEditTime/LastEditors"
        },
        "switch": {
            "newlineAddAnnotation": true
        },
        "supportAutoLanguage": [],
        "prohibitAutoAdd": [
            "json",
            "*"
        ],
        "prohibitItemAutoAdd": [
            "项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
        ],
        "moveCursor": true,
        "dateFormat": "YYYY-MM-DD HH:mm",
        "atSymbol": "@",
        "atSymbolObj": {
            "文件后缀": "修改它的@符号"
        },
        "colon": ": ",
        "colonObj": {
            "文件后缀": "修改它的冒号"
        },
        "filePathColon": "路径分隔符替换",
        "showErrorMessage": false,
        "wideSame": true,
        "wideNum": 15,
        "CheckFileChange": false,
        "createHeader": true,
        "useWorker": false,
        "typeParam": false,
        "designAddHead": false,
        "headDesignName": "random",
        "headDesign": false
    },
    "fileheader.cursorMode": {
        "brief  "  : "",
        "param  "  : "",
        "return " : ""
    },
    "fileheader.customMade": {
        "Descripttion":"",
        "version":"",
        "Author":"",
        "Date":"Do not edit",
        "LastEditTime":"Do not Edit",
    },
    "C_Cpp.commentContinuationPatterns": [
        "/**"
    ],
}

注释效果如图:
头文件注释:

/*******************************************************************
 * @Descripttion   : 头文件注释
 * @version        : V1.0.0
 * @Author         : FangJijun
 * @Date           : 2020-10-12 10:14
 * @LastEditTime   : 2020-10-12 12:43
*******************************************************************/

函数注释:

/******************************************************************
 * @brief  : 函数注释
 * @param  : none
 * @return : none
*******************************************************************/
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值