This is a header extension that contains multiple languages.
Feel good friends please give a star ~
- Usage cookiecutter-vscode create project.
- Custom fileheader Extension template
1. ctrl + shift + x
2. Search VSCodeFileHeader
or
1. ctrl + p
2. ext install jankincai.vscodefileheader
- Support for automatic update time and author
- Support for custom template(header/body)
- Support for multiple languages
- Support for suffix name mapping templates
- Support for ignore suffix
- Support for manual and automatic insert comment
- Support vscode variables
- Support remote synchronization(install git)
- ActionScript
- AppleScript
- ASP
- Batch
- C
- C#
- C++
- Clojire
- CSS
- D
- Dart
- Erlang
- Go
- Haskell
- HTML
- Java
- JavaScript
- LaTeX
- Lisp
- Lua
- Matlab
- Objective-C
- OCaml
- Pascal
- Perl
- PHP
- Python
- R
- Ruby
- Scala
- SCSS
- ShellScript
- SQL
- TypeScript
- Vue
- XML
- YAML
# Settings
{
"fileheader.author": "JanKinCai",
}
# Save file or ``ctrl + alt + i`` insert comment
{
# Set author
"fileheader.author": "Your name",
# Set insert body switch, default false
"fileheader.body": true,
# Set open file to insert header comment, default false
"fileheader.open": true,
# Set save file to insert header comment, default true
"fileheader.save": true,
# find max line of header comment, default 10
"fileheader.header_max_line": 10,
# Set datetime format, default YYYY-MM-DD HH:mm:ss
# moment.js
"fileheader.dateformat": "YYYY-MM-DD HH:mm:ss",
# Set template mapping
"fileheader.file_suffix_mapping": {
".pyx": "Python",
"jkc-*.h": "H"
},
"fileheader.ignore": [
"*.txt", # Ignore suffix name
"test.py", # Ignore file
"test" # Ignore dir
]
}
Note: The template header connot be modified and can be added.
Custom Header template template/header/Python.tmpl
:
# @Author: {{author}}
# @Date: {{create_time}}
# @Email: {{email}}
# @Last Modified by: {{last_modified_by}}
# @Last Modified time: {{last_modified_time}}
Custom Body template template/body/Python.tmpl
:
def main():
print("Hello, World!")
if __name__ == "__main__":
main()
Settings:
{
# Set template path
"fileheader.custom_template_path": "xxx/template/",
# Set other config
"fileheader.other_config": {
"email": "Your email",
}
# Set suffix mapping
"fileheader.file_suffix_mapping": {
".py": "Python"
},
}
Custom Header template template/header/JKC.tmpl:
# @Name: {{name}}
Custom Header template template/body/JKC.tmpl:
settings:
{
"fileheader.is_header_exists": "@Name:",
"fileheader.other_config": {
"name": "jankincai",
},
"fileheader.file_suffix_mapping": {
".jkc": "JKC"
},
}
https://code.visualstudio.com/docs/editor/variables-reference
Custom Header template template/header/Python.tmpl
:
# @Author: {{author}}
# @Date: {{create_time}}
# @Last Modified by: {{last_modified_by}}
# @Last Modified time: {{last_modified_time}}
# {{workspaceFolder}}
# {{workspaceFolderBasename}}
# {{file}}
# {{relativeFile}}
# {{relativeFileDirname}}
# {{fileBasename}}
# {{fileBasenameNoExtension}}
# {{fileDirname}}
# {{fileExtname}}
# {{cwd}}
{
# Set template path
"fileheader.custom_template_path": "xxx/template/",
# set ssh, https://jdblischak.github.io/2014-09-18-chicago/novice/git/05-sshkeys.html
# "fileheader.remote": "git@github.com:caizhengxin/vscodefileheader.git"
"fileheader.remote": "https://github.com/caizhengxin/vscodefileheader.git"
}