Automatically (or via command or shortcut) insert (and update) file header text (author comment). Easy configuration and powerful customization to fit any needs!
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
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 🤤
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 👍
Use Case Examples (extending default settings)
Insert a simpler header in plain text files (via command/shortcut) βοΈ User settings.json
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
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