I can't really sell this as a solution, as it requires quite a lot more involvement than a simple configuration file should, but I use Nix Home Manager with Plasma Manager for this.
This is part of the tooling you'd use on NixOS, but you can use it on other distros, too, and it generally works fine (although I'm not sure, if the current version of Plasma Manager still supports Plasma 5, in case you're still on a distro with that).
Basically, it allows you to define e.g. keyboard shortcuts like this:
shortcuts = {
ksmserver = {
"Lock Session" = [
"Screensaver"
"Meta+Ctrl+Alt+L"
];
};
kwin = {
"Expose" = "Meta+,";
"Switch Window Down" = "Meta+J";
"Switch Window Left" = "Meta+H";
"Switch Window Right" = "Meta+L";
"Switch Window Up" = "Meta+K";
};
};
It then fucks up the formatting, so that it looks like KDE expects, and throws it into ~/.config/kglobalshortcutsrc.
(KDE does actually have a text-based config, it's just borderline unusable.)
Well, and you can do this with lots of other Plasma options, too. Here's their official example: https://github.com/nix-community/plasma-manager/blob/trunk/examples/home.nix