
This extension is an unaffiliated community fork of vscode-42header by @kube, the original author. All credit for the underlying header generator goes to him.
If you only need the classic 42 header behavior, install the original:
kube.42header.
Install this fork if you specifically want one of the additions listed below.
Why this fork exists
The original extension has been stable for years and does its job well. This fork was created to scratch a few specific itches that came up at newer 42 campuses, and to keep the dependency tree current after the upstream went quiet:
- Multi-campus email derivation. The upstream extension assumes a single email domain. This fork ships a dropdown of 35+ 42 campuses and derives
username@student.<campus> automatically — handy if you switch between campuses or work on shared machines where USER/MAIL env vars don't match your school identity.
- In-editor keybinding remap. A
42 Header: Change Keybinding command opens the keybindings UI scoped to this extension, so you don't have to hand-edit keybindings.json.
- Security patches. Upstream
moment was pinned to 2.17.1 (2017), which carried two known advisories (ReDoS + path traversal). This fork tracks current patch versions.
- Activation cost. Activation event was switched from
* to onStartupFinished, removing a small startup cost without changing functionality.
- Tests + CI. A unit/integration test suite runs on Linux, macOS, and Windows on every PR.
If none of those apply to your setup, the original is the right pick.
What is not different
The header format itself, the insert shortcut behavior, the auto-update-on-save, and the language delimiter handling are unchanged from upstream. This fork is additive — output bytes are byte-identical to the original for the same inputs.
Side-by-side
|
Original kube.42header |
This fork ensui-dev.42header-plus |
| Header format |
✅ canonical 42 header |
✅ identical output |
| Insert shortcut |
✅ Ctrl/Cmd+Alt+H |
✅ same default, remappable in-editor |
| Auto-update on save |
✅ |
✅ |
| Email source |
env var only |
env var, manual setting, or campus dropdown |
| Campus presets |
❌ |
✅ 35+ |
| Activation |
* (eager) |
onStartupFinished |
moment version |
2.17.1 |
current |
| Test suite |
minimal |
unit + integration, multi-OS CI |
| Maintenance status |
quiet since ~2020 |
actively maintained (community) |
Install
ext install ensui-dev.42header-multicampus
Or search for "42 Header Multi-Campus" in the VS Code Extensions view.
Available on:
Usage
Insert a header:
- macOS: ⌘ + ⌥ + H
- Linux / Windows: Ctrl + Alt + H
The header updates automatically on save.
Configuration
Default username and email are read from environment variables (same as upstream). Override in User Settings:
{
"42header.username": "string",
"42header.email": "string", // wins over campus-derived email
"42header.campus": "string" // see dropdown for full list
}
Campus dropdown (fork-only)
Choosing a campus auto-fills your email as username@student.<campus>. Setting 42header.email manually overrides it.
Supported campuses include — but are not limited to:
- 🇵🇹 Portugal:
42lisboa.com, 42porto.com
- 🇫🇷 France:
42.fr, 42lyon.fr, 42mulhouse.fr, 42perpignan.fr
- 🇪🇸 Spain:
42barcelona.com, 42madrid.com, 42malaga.com, 42urduliz.com
- 🇩🇪 Germany:
42berlin.de, 42heilbronn.de, 42wolfsburg.de
- 🇮🇹 Italy:
42firenze.it, 42roma.it
- 🇳🇱 Netherlands:
codam.nl
- 🇲🇦 Morocco:
1337.ma
- and more — see the dropdown in Settings for the complete list.
Remap the shortcut (fork-only)
Open the Command Palette (F1) and run "42 Header: Change Keybinding". This opens the standard keybindings UI pre-filtered to this extension's command.
Development
npm install
npm run build # compile
npm test # run integration tests
npm run test:unit # unit tests only
npm run lint # type-check
CI runs the full suite on Node 18.x and 20.x across Linux, macOS, and Windows.
See CONTRIBUTING.md for PR guidelines.
Issues & contributions
This fork is maintained on GitHub at ensui-dev/vscode-42header-plus. Please file fork-specific issues there. For bugs in the underlying header generator that also reproduce on the original kube.42header, please report them upstream so the fix benefits both communities.
Credits & License
This project is not endorsed by, affiliated with, or sponsored by 42, the 42 Network, or any 42 campus.