中文文档
Features
Full customizable. Write your own template with javascript logic
Preset Template Supported Languages
- [x] Javascript/Typescript
- [x] Python
- [x] CSS, Less, SCSS
- [x] HTML/XML
- [x] Vue
- [x] Java
- [ ] Rust Comming soon🚀
- [ ] Golang Comming soon🚀
Usage
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.
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
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
- [ ] Add support for other languages in VSCode known identifiers
- [ ] Add support for other VCS
- [ ] Integration test and unit test