Friday, September 4, 2009

An Emacs keybindings help tip

In Emacs, C-h k or C-h m will show you the help regarding what function is bound to the key or what keys are bound in the buffer you're currently working on.  If it's a drag to scroll through the entire list or if you want to narrow it down, you can press the prefix keys and then C-h to get only those keybindings that start with the prefix key. 

For example, pressing the prefix C-x r and then C-h  (C-x r C-h) will only show the help regarding the key bindings starting with the prefix C-x r.  This is useful when you enable a minor mode that has a prefix key combination that you use infrequently.  In the normal case, you'd have to invoke C-h m and then scroll down to the respective section in the help buffer.  If you knew the prefix, then pressing the prefix followed by C-h will be "context" sensitive help.

Based on the thread here on