A VS Code extension that automatically generates and inserts customizable file headers with author info, creation time, and copyright notices.
Features
- 🚀 One-click file header insertion
- 🌍 Multi-language support (English & Chinese)
- ⚙️ Customizable templates
- 🎨 Beautiful formatting
- 📅 Automatic timestamp management
- 🔄 Auto-insert for new files
Privacy
This extension:
- Does not collect any user data
- Does not send any information over the network
- Only operates on local files within your workspace
- Does not require any special permissions beyond basic file operations
Usage
- Open a file in VS Code
- Click the "File Header" button in the status bar, or
- Press
Ctrl+Shift+P
and type "Insert File Header"
- The header will be automatically inserted at the top of your file
Configuration
You can customize the header template through VS Code settings:
- Open Command Palette (
Ctrl+Shift+P
)
- Search for "Configure File Header Settings"
- Modify the following settings:
- Author name
- Company name
- License type
- Header template
- Auto-insert option
Template Variables
The following variables are available in templates:
- ${filename} - Current file name
- ${author} - Author name
- ${company} - Company name
- ${year} - Current year
- ${createTime} - File creation time
- ${lastModifiedTime} - Last modification time
- ${license} - License type
Examples
Default English Template
```javascript
/**
- @file ${filename}
- @version 1.0.0
- @author ${author}
- @description
- @copyright (c) ${year} ${company}
- @license ${license}
- @create ${createTime}
- @update ${lastModifiedTime}
*/
```
Default Chinese Template
```javascript
/**
- @文件名 ${filename}
- @版本 1.0.0
- @作者 ${author}
- @说明
- @版权所有 (c) ${year} ${company}
- @许可证 ${license}
- @创建时间 ${createTime}
- @最后修改 ${lastModifiedTime}
*/
```
Installation
- Open VS Code
- Press
Ctrl+P
- Type
ext install file-header-generator
Requirements
VS Code version 1.69.0 or higher
Extension Settings
This extension contributes the following settings:
fileHeaderGenerator.author
: Author name to be used in file headers
fileHeaderGenerator.company
: Company name to be used in file headers
fileHeaderGenerator.license
: License type to be used in file headers
fileHeaderGenerator.template
: Custom template for file header
fileHeaderGenerator.autoInsert
: Enable/disable automatic header insertion for new files
Release Notes
0.0.1
Initial release of File Header Generator:
- Basic file header generation
- Multi-language support
- Customizable templates
- Status bar integration
License
Copyright (c) 2024 Zest. All rights reserved.
This extension is proprietary software. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited without the express permission of the copyright holder.
The software is provided "as is", without warranty of any kind, express or implied. In no event shall the authors or copyright holders be liable for any claim, damages or other liability arising from the use or distribution of the software.