Skip to content

IronLu233/fileheader-pro

Repository files navigation

Fileheader Pro

.github/workflows/main.yml Visual Studio Marketplace Rating Visual Studio Marketplace Downloads

中文文档

Features

Full customizable. Write your own template with javascript logic

CustomFileheader

Auto add file header when create new file. No need to add file header manually

AutoInsert

Auto update file header when save file

AutoUpdate

Preset Template Supported Languages

  • Javascript/Typescript
  • Python
  • CSS, Less, SCSS
  • HTML/XML
  • Vue
  • Java
  • Rust Comming soon🚀
  • Golang Comming soon🚀

Usage

Manually add file header

Open your file and press Ctrl+Shift+P(Command+Shift+P on Mac).

Then type "Fileheader Pro: Add Fileheader" a default file header will insert into your file.

Disable some fields

See Extension Settings section. there is a FileheaderPro.disableFields property.

Add your disabled fields in your VSCode setting.

Disable authorName will disable the author Email too.

image

image

Customize fileheader with template

Press Ctrl+Shift+P(Command+Shift+P on Mac) for open your command palette.

Then type "Fileheader Pro: Generate Custom Fileheader Template" A new template file will be generated in your ${workspaceRoot}/.vscode/fileheader.template.js

Then modify the template file and save it. Your custom file header will take effect.

Old template can not be recognized now. Do not forget remove old fileheader. And debug your template first before you want to use it in your production

image

Extension Settings

Setting Default Value Description
FileheaderPro.currentUserName The fixed current user. The default is from your VCS
FileheaderPro.currentUserEmail The fixed current user email. The default is from your VCS
FileheaderPro.companyName YourCompanyName Company name, please replace to your owns
FileheaderPro.dateFormat 'YYYY-MM-DD HH:mm:ss' The date format, see https://momentjs.com/docs/#/displaying/format
FileheaderPro.autoInsertOnCreateFile true Auto insert file header when create new file
FileheaderPro.autoUpdateOnSave true Auto update file header when save file
FileheaderPro.disableFields ["mtime"] Disable fields in fileheader. For default fileheader template, the contain fields are omitted. mtime may take code merge conflict. Thus I disable it by default

Known Issues

Due to API limit, modify the source code and then manually edit to original in VCS will change the modified time.

If user manually change the birthtime to earlier, Fileheader pro will not update birthtime substring.

mtime of template variable may have some issues. If you find any issue, please report to GitHub Issue

TODOS