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!
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 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: "[<language>]": { "powerHeader.<setting>": ... } , to achieve your desired header style 👍 |
-
Insert a simpler header in plain text files (via command/shortcut) ⚙️ User settings.json
"[plaintext]": { "powerHeader.commentMode": "raw", "powerHeader.template": "Author: <author> (email) / $TM_FILENAME @ !date!" }
let's make this work ⏩ automatically for plain text files only:
"[plaintext]": { "powerHeader.autoInsert.enable": true, "powerHeader.autoInsert.allow": "always", "powerHeader.commentMode": "raw", "powerHeader.template": "Author: <author> (email) / $TM_FILENAME @ !date!" }
-
Use another header for that client project ⚙️ Workspace settings.json
"powerHeader.template": "file://$WORKSPACE_FOLDER/dev/template.txt"
-
Your company requires you to use a specific header template in
cpp
? Easy! ⚙️ <any>"[cpp]": { "powerHeader.commentMode": "line", "powerHeader.template": "https://intranet.company.com/static/templates/cpp/header", }
See Feature Contributions tab
Unfortunately current Feature Contributions Description column does not support markdownDescription 🐞 issue here
🐞 "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