- C++ 91.8%
- Shell 4.3%
- CMake 3.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
CI / build-and-test (opensuse/leap:16.0) (push) Successful in 2m45s
CI / build-and-test (fedora:latest) (push) Successful in 3m7s
CI / build-and-test (debian:stable) (push) Successful in 4m36s
CI / build-and-test (ubuntu:26.04) (push) Successful in 4m4s
CI / build-and-test (opensuse/tumbleweed:latest) (push) Successful in 16m58s
Installing git on its own first pulls in BusyBox's awk on Tumbleweed, which conflicts with the real awk (gawk) that the KDE development packages need in the next step. Install gawk together with git. scripts/container-test.sh now installs git in a separate first step, exactly like the CI job, so local runs catch differences like this. |
||
| .forgejo/workflows | ||
| docs | ||
| scripts | ||
| src | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| CHANGELOG.md | ||
| CMakeLists.txt | ||
| CREDITS.md | ||
| LICENSE | ||
| README.md | ||
kate-42header
The 42 school header, for the Kate text editor.
At 42, every source file you hand in starts with the same signed ASCII-art block: your login, your email, when you created the file and when you last changed it. Vim and VS Code users get it from a plugin. This project gives Kate (KDE's editor) users the same thing, so you can code in Kate without typing or patching headers by hand.
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kontebria <kontebria@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/10/22 14:30:00 by kontebria #+# #+# */
/* Updated: 2026/10/22 14:30:00 by kontebria ### ########.fr */
/* */
/* ************************************************************************** */
The header it writes is identical, byte for byte, to the one the official 42 vim plugin (42paris/42header) produces, so it passes the same checks and looks the same in your classmates' editors.
What it does for you
- Adds the header in one keystroke. Press
Ctrl+Alt+H(orTools → Insert 42 Header) and the header appears at the top of the file. - Keeps it up to date. Every time you save, the
Updated:line gets the current date and time, so the file on disk always carries the right header. Only the file you save is touched, and only if it already has a header. Nothing is ever added behind your back. - Never rewrites your authorship. The
By:andCreated:lines stay as they were. PressingCtrl+Alt+Hon a file that already has a header just refreshes the file name and theUpdated:line. - Fixes the classic git merge conflict. Two people saving the same file
means two different
Updated:lines and a conflict in the header. When you open such a file, the conflict is cleaned up automatically. - Stays out of the way during a rebase. While
git rebaseis running, headers are left alone, so you don't create extra conflicts. - Works with any language. C and C++ get
/* */, Python and shell get#, HTML gets<!-- -->, Lua gets--, and so on. Files it doesn't recognise (Makefile,Dockerfile, ...) get#comments.
Install
You need Kate 24.02 or newer (the KDE 6 generation, which current Linux distributions ship). On openSUSE, Fedora, Debian or Ubuntu:
git clone https://git.asidia.com/kontebria/kate-42header.git
cd kate-42header
sudo scripts/install-deps.sh # the compiler, CMake and KDE development packages
scripts/build-and-test.sh # builds into build/ and runs the tests
sudo cmake --install build
On other distributions, install the packages listed in
docs/BUILDING.md instead of running install-deps.sh.
Then switch it on in Kate: Settings → Configure Kate → Plugins, tick
42 Header and click Apply.
Set your name and email
By default the header uses your system login ($USER) and the $MAIL
environment variable. On 42 machines these are usually already right.
To use something else, open Settings → Configure Kate → 42 Header and
fill in your login and your email (<login>@student.42.fr). Leave a field
empty to go back to the default. You can also turn off the automatic update
on save there.
Is it reliable?
The project has an automated test suite. It checks the output against headers produced by the original vim plugin, and it drives the real plugin code on real Kate documents: inserting, saving, merge conflicts, rebases, undo, the settings page, and loading the plugin the way Kate does. Every change is built and tested on openSUSE (Tumbleweed and Leap 16), Fedora, Debian and Ubuntu.
More details
- docs/BUILDING.md: requirements, packages for other distributions, how the code is organised, and how CI works.
- docs/FIDELITY.md: how the header matches the original plugin exactly, and the precise refresh, conflict and rebase rules.
- CHANGELOG.md: what changed in each version.
License
MIT. See LICENSE. The notices of the projects this is based on, 42paris/42header and kube/vscode-42header, are kept in CREDITS.md.