Vscode adds shortcut keys for header comments

Install the extension inside vscode:
insert image description here

Add the following code in the settings.json file: replace "XXXX" with your favorite nickname.

{
    
    
    "psi-header.changes-tracking": {
    
    },
    "psi-header.templates": [
        {
    
    
            "language": "*",
            "template": [
                "File: <<filename>>",
                "Project: <<projectname>>",
                "File Created: <<filecreated('dddd, Do MMMM YYYY h:mm:ss a')>>",
                "Author: XXXX",
                "Description: ",
                "-----",
                "Last Modified: <<dateformat('dddd, Do MMMM YYYY h:mm:ss a')>>",
                "Modified By: XXXX",
                "-----",
                "Copyright <<projectCreationYear>> - <<year>> <<copyrightholder>>, <<company>>"
            ]
        }
    ],
    "psi-header.config": {
    
    
        "autoAdd": true,
    },
    // 头部注释
    "fileheader.customMade": {
    
    
        // 头部注释默认字段
        "Author": "XXXX",
        "Date": "Do not edit", // 设置后默认设置文件生成时间
        "LastEditTime": "Do not edit", // 设置后,保存文件更改默认更新最后编辑时间
        "LastEditors": "XXXX", // 设置后,保存文件更改默认更新最后编辑人
        "Description": "",
        "FilePath": "Do not edit", // 设置后,默认生成文件相对于项目的路径
    },
    // 函数注释
    "fileheader.cursorMode": {
    
    
        // 默认字段
        "description": "",
        "param": "",
        "return": ""
    },
    "fileheader.configObj": {
    
    
        "createFileTime": true,
        "language": {
    
    
            "languagetest": {
    
    
                "head": "/$$",
                "middle": " $ @",
                "end": " $/"
            }
        },
        "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"
        ],
        "prohibitItemAutoAdd": [
            "项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
        ],
        "moveCursor": true,
        "dateFormat": "YYYY-MM-DD HH:mm:ss",
        "atSymbol": [
            "@",
            "@"
        ],
        "atSymbolObj": {
    
    
            "文件后缀": [
                "头部注释@符号",
                "函数注释@符号"
            ]
        },
        "colon": [
            ": ",
            ": "
        ],
        "colonObj": {
    
    
            "文件后缀": [
                "头部注释冒号",
                "函数注释冒号"
            ]
        },
        "filePathColon": "路径分隔符替换",
        "showErrorMessage": false,
        "wideSame": false,
        "wideNum": 13,
        "functionWideNum": 0,
        "CheckFileChange": false,
        "createHeader": true,
        "useWorker": false,
        "designAddHead": false,
        "headDesignName": "random",
        "headDesign": false,
        "cursorModeInternal": false
    },
    //其他样式
    "editor.fontSize": 15,
    "window.zoomLevel": 0,
    "vetur.format.defaultFormatterOptions": {
    
    
        "js-beautify-html": {
    
    
            // "wrap_attributes": "force-expand-multiline"
            "wrap_attributes": "auto",
            "wrap_line_length": 200,
        },
    },
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "git.ignoreWindowsGit27Warning": true,
    "vetur.grammar.customBlocks": {
    
    
        "docs": "md",
        "i18n": "json"
    },
}

Guess you like

Origin blog.csdn.net/qq_39877681/article/details/127614697