Search code examples
emacskey-bindings

In emacs is there a way to view all user-defined key bindings?


I'm looking for a list of the ones I've defined myself, distinct from any stock bindings or bindings added by installed packages.

I've searched through help and info and haven't found anything useful. Google is surprisingly silent on the matter.


Solution

  • Emacs sees no difference at all between key bindings defined by core code, those defined by third-party code you've installed, and those you've defined yourself. There's no associated data which you can query to make that distinction.

    There presumably aren't very many files that your custom key bindings could possibly be in, though, and you'll have a pretty good idea of what those are.

    If you're at a loss, then I suggest you do this:

    M-x rgrep RET \(define\|\(global\|local\)-set\)-key RET *.el RET ~/.emacs.d/ RET

    You can then C-xC-q to make the grep buffer writeable, and M-x flush-lines RET /elpa/ RET to get rid of the packages (and similarly for anything else you don't want to include).