2024-04-08 Even more Magit tips

Almost five years ago I wrote a short post with some Magit tips. Well, why not write some more? Magit is slowly but constantly evolving, and recently I discovered something very useful I didn’t even know existed.

Magit defines the variable magit-define-global-key-bindings, with a default value being, well, the symbol default. This value means that Magit defines a few keybindings accessible from anywhere in Emacs. These are:

The only drawback I can see is that the C-x M-g and C-c M-g bindings are not very easy to remember. This can be remedied with setting magit-define-global-key-bindings to recommended. In that case, magit-dispatch gets bound to C-c g (I assume that here, g stands for “global”) and magit-file-dispatch to C-c f (supposedly, f standing for file). These bindings could not be made default because keys like C-c <letter> are reserved for the user, but it’s of course fine to use them if the user explicitly asks for that.

That’s it for today, I really hope this is useful for some of you out there!

CategoryEnglish, CategoryBlog, CategoryEmacs, CategoryGit