Is there a way to enable Emacs keybindings everywhere on NixOS?


This is my config file for NixOS and I must admit that I have a big love for Emacs.

As you see, I am using GNOME as a Desktop Environment. Also, on line 80, you can see that I have installed GNOME-tweaks and you can see below that I have enabled a feature called gnome-tweaks.

It works for some things. For instance, C-a (beginning of line), C-e (end of line), C-f (char forward), M-f (word forward), and others.

But, it does not work for others, such as copy, paste, cut.

Some folks use Autokey (example of what I want). But I had a bad experience with it in the past.

Hence, does anyone have an alternative recommendation on how to handle Emacs keybindings everywhere in NixOS?

Would leaving GNOME as a Desktop Environment and migrating to Emacs Window Manager (EXWM) solve this?


I can’t speak to changing gnome keybindings, but a quick duckduckgo suggests that gtk 4 has completely disabled changing those specific keybindings: drop keyboard themes (#1669) · Issues · GNOME / gtk · GitLab (no brigading, please, they have enough of that)

On gtk3, apparently you can do it through a theme, but I think that ship has sailed for most applications you’ll care about.

Without making any kind of judgement about this decision, gnome have pretty consistently been removing niche customizations like this over the last few releases, so it’s not surprising.

You’ll have to patch it downstream if you want that change, luckily that’s relatively easy on NixOS, but will probably take a fair bit of digging into gtk source code.

Not really. It will remove the cases where it’s literally the gnome desktop (e.g., the application search bar), but gtk provides these shortcuts. Most applications you care about will continue to use C-v.

Some applications might have ways to override it though, you can use some firefox extensions, for example.

Maybe if you also replace all your applications with EAF ones?