Removing Emacs Key Bindings

Once you’ve been sucked into the event horizon of your Emacs configuration, you’re always adding new bindings. Sometimes it’s for a homegrown function, sometimes it’s to configure a new package. If you longer needed one of those bindings, it’s trivial to simply remove it from your init.el or whatever you’re using.

Sometimes, though, some other package steals one of your bindings. You can either change yours or disable theirs. The question is: how do you disable a binding that’s not in your configuration?

Bozhidar Batsov over at EmacsRedux has the answer. It’s pretty simple: you simply set the binding to nil. He gives the example of paredit adding a binding the conflicted with one used by one of the REPL modes but we’ve all experienced the phenomenon. You can remove a binding globally or locally. Batsov also mentions using global-unset-key or local-unset-key to remove a binding.

Thankfully, this is not something the we have to do very often but it’s nice to know how to do it when the need arrives.

This entry was posted in General and tagged . Bookmark the permalink.