vscode使用psioniq File Header自动添加文件头并保存最后更新时间

把快捷键写在前面以便查询:

  1. 插入文件头,按两次 ctrl+alt+H
  2. 插入Change Log,按两次 ctrl+alt+c
    注意mac也使用ctrl键而不是cmd键。
  1. 首先在扩展库中搜索psioniq File Header并点击安装。
  2. 设置-扩展中找到psioniq File Header
    vscode使用psioniq File Header自动添加文件头并保存最后更新时间_第1张图片
    vscode使用psioniq File Header自动添加文件头并保存最后更新时间_第2张图片
  3. 点击在settings.json中编辑

vscode使用psioniq File Header自动添加文件头并保存最后更新时间_第3张图片,我的配置文件:

"psi-header.config": {
        "forceToTop": true,
        "blankLinesAfter": 3,
        "license": "Custom"
    },
"psi-header.changes-tracking": {
        "isActive": true,
        "modAuthor": "Modified By: ",
        "modDate": "Last Modified: ",
        "modDateFormat": "date",
        "include": [],
        "exclude": [
            "markdown",
            "json"
        ],
        "excludeGlob": [
            "out/**",
            "src/**/*.xyz",
            "components/**/*.mk",
        ],
        "autoHeader": "manualSave"
    },
    "psi-header.license-text": [
        "May the force be with you."
    ],
    "psi-header.variables": [
        ["company", "SimonLiu Inc."],
        ["author", "Simon Liu"],
        ["authoremail", "[email protected]"],
        ["initials","S.L"],
    ],
    "psi-header.lang-config": [
        {
            "language": "lua",
            "begin": "--[[",
            "prefix": "--",
            "end": "--]]",
            "blankLinesAfter": 0
        },
        {
            "language": "python",
            "begin": "###",
            "prefix": "# ",
            "end": "###",
            "blankLinesAfter": 0,
            "beforeHeader": [
                "#!/usr/bin/env python",
                "# -*- coding:utf-8 -*-"
            ]
        },
        {
            "language": "javascript",
            "begin": "/**",
            "prefix": " * ",
            "end": " */",
            "blankLinesAfter": 2,
            "forceToTop": false
        },
        {
            "language": "typescript",
            "mapTo": "javascript"
        }
    ],
    "psi-header.templates": [
        {
            "language": "c",
            "template": [
                "File: <>",
                "Project: <>",
                "Created Date: <>",
                "Author: <>",
                "-----",
                "Last Modified: <>",
                "Modified By: ",
                "-----",
                "Copyright (c) <> <>",
                "",
                "<>",
                "-----",
                "HISTORY:",
                "Date      \tBy\tComments",
                "----------\t---\t----------------------------------------------------------"
            ],
            "changeLogCaption": "HISTORY:",
            "changeLogHeaderLineCount": 2,
            "changeLogEntryTemplate": [
                "<>\t<>\t"
            ]
        },
        {
            "language": "javascript",
            "template": [
                "File: <>",
                "Project: <>",
                "Created Date: <>",
                "Author: <>",
                "-----",
                "Last Modified: ",
                "Modified By: ",
                "-----",
                "Copyright (c) <> <>",
                "------------------------------------",
                "Javascript will save your soul!"
            ]
        },
        {
            "language": "typescript",
            "mapTo": "javascript"
        }
    ]
  1. 效果如下
    vscode使用psioniq File Header自动添加文件头并保存最后更新时间_第4张图片

你可能感兴趣的:(Visual,Studio,Code,vscode,file,head,文件头)