https://github.com/5P5/vscode-file-header
Automatically (or by command or shortcut) insert (and update) file header text (author comment). Easy configuration and powerful customization to fit any needs!
https://github.com/5P5/vscode-file-header
author automated automatic comment copyright custom customization easy easy-to-use file-header file-info header info license multi-root multiroot power vscode vscode-extension
Last synced: 10 months ago
JSON representation
Automatically (or by command or shortcut) insert (and update) file header text (author comment). Easy configuration and powerful customization to fit any needs!
- Host: GitHub
- URL: https://github.com/5P5/vscode-file-header
- Owner: 5P5
- License: other
- Created: 2020-04-11T18:59:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T18:41:28.000Z (almost 3 years ago)
- Last Synced: 2024-10-24T06:30:30.853Z (about 1 year ago)
- Topics: author, automated, automatic, comment, copyright, custom, customization, easy, easy-to-use, file-header, file-info, header, info, license, multi-root, multiroot, power, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=epivision.vscode-file-header
- Size: 754 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
๐ Power Header ๐ฅ
Power Header automatically (or via command/shortcut Ctrl+Alt+H) inserts (and updates) file header text (author comment).
Power Header offers easy configuration and powerful customization to fit any needs!

## Features
> The following are abridged descriptions. Please see in **Power Header** settings for all the juicy delicious details ๐คค
| What you ask for โ | What you get โ |
|:-:|---|
| ๐๏ธ Supported Languages | ๐ฏ% all of them! |
| โฉ Automatic Header Insert and Update | Sir, yes, sir!
Automagically โจ insert header into new files (๐ black-/whitelist-support *of course*) and update on save.
Not a single keyboard shortcut pressed! |
| ๐ Header Template | can be a **text string**, ๐
read from a **local file**, ๐ฒ
or even a **remote resource**! ๐คฏ (http(s)://)|
| ๐ Variables for Interpolation in Template | **Ain't no hard-coded fields BS here!**
You can do whatever the f๐ค you want!
Use all [vscode snippet variables](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_variables) and define custom variable pairs โ they can even be JavaScript code, allowing for arbitrary complex text, date formats, etc.! ๐ |
| ๐ฌ Comment Styles | โฌ Block Comment style,
โ Line Comment style,
๐ or Insert header as is (your very own style). |
| ๐ Header Content Update | Update the header via command/shortcut or automatically on file save.
JavaScript regular expression replace allows for arbitrary complex text updates. ๐
Use with caution โ ๏ธ |
| Wow, all this is awesome ๐ฎ, but I have that super rare special edge-case in my multi-root workspace for this file language ๐ฅบ
*โ I hear you say* โ | Harness the full **Power Header** and *VS Code* built-in power ๐ฅ
You can always overwrite all **Power Header** settings in a (*Workspace* or *.vscode* folder) *settings.json*, even language specific: `"[]": { "powerHeader.": ... }`, to achieve your desired header style ๐ |
## Use Case Examples (extending default settings)
1. Insert a simpler header in plain text files (via command/shortcut) โ๏ธ *User settings.json*
```json
"[plaintext]": {
"powerHeader.commentMode": "raw",
"powerHeader.template": "Author: (email) / $TM_FILENAME @ !date!"
}
```
let's make this work โฉ automatically for plain text files only:
```jsonc
"[plaintext]": {
"powerHeader.autoInsert.enable": true,
"powerHeader.autoInsert.allow": "always",
"powerHeader.commentMode": "raw",
"powerHeader.template": "Author: (email) / $TM_FILENAME @ !date!"
}
```
1. Use another header for that client project โ๏ธ *Workspace settings.json*
```jsonc
"powerHeader.template": "file://$WORKSPACE_FOLDER/dev/template.txt"
```
1. Your company requires you to use a specific header template in `cpp`? Easy! โ๏ธ \
```jsonc
"[cpp]": {
"powerHeader.commentMode": "line",
"powerHeader.template": "https://intranet.company.com/static/templates/cpp/header",
}
```
## Extension Settings
See *Feature Contributions* tabโคด๏ธ and better check in *Settings*โก๏ธ*Extensions*โก๏ธ**Power Header** for detailed explanation.
> Unfortunately current *Feature Contributions* Description column does not support markdownDescription [๐ issue here](https://github.com/microsoft/vscode/issues/88927)
## Known Issues
๐ `"powerHeader.update.enable": "save"` will not work correctly in combination with `"files.autoSave": "onFocusChange"`
(The focus-losing document will be saved nonetheless, but *header content update* will be tried in the focus-gaining (editable) editor)
๐ฉน Workarounds:
If you want to keep `"files.autoSave": "onFocusChange"` set `"powerHeader.update.enable": "manual"`
or use `"powerHeader.update.enable": "save"` with `"files.autoSave": "off|afterDelay|onWindowChange"` setting