0

I simply want to get the list of shortcuts.

For example, when my cursor is in Treemacs, I press '?' and then mini-buffer opens which show all available shortcuts. But same thing isn't true for other major modes like 'eww' etc.
I simply don't want to navigate to documentation everytime.

I use 'helm' if it helps!

Thank you!

deepanshu
  • 141
  • 4

1 Answers1

1

Normally I use C-h m (M-x describe-mode) for this task.

The opened *Help* buffer lists currently used modes, and then short information on each of the modes, starting with the major one and usually providing a list of available key bindings.

Additionally, in some major modes, ? and/or C-h output the most - expectedly - useful key bindings.

Also, there's a very useful M-x describe-keymap command, available since Emacs 28.1 (current development snapshot 28.0.50). I often use it when I'd like to explore a particular keymap without going to the source (so not only the currently active major-mode's bindings). For example, M-x describe-keymap <RET> dired-mode-map.

P.S. You might also find it helpful to take a look at C-h ? for the list of the most useful help bindings.
C-h m is currently listed as the first one (in my setup).

Y. E.
  • 668
  • 4
  • 8
  • `describe-keymap` is not available in vanilla emacs-27.2? At least, not in my vanilla 27.2. – Fran Burstall Aug 28 '21 at 11:35
  • @FranBurstall function `describe-keymap` was added on 24th of Aug 2019, so it should be available in [`Emacs` >= 26.3](https://www.gnu.org/software/emacs/history.html). See [help-fns.el blame](https://github.com/emacs-mirror/emacs/blame/master/lisp/help-fns.el) with the changes to this function during the last 2 years. – Y. E. Aug 28 '21 at 13:15
  • I found 'helm-descbinds' helpful which was recommended in the link mentioned by Tyler in his comment. – deepanshu Aug 28 '21 at 15:22
  • @Y.E. `describe-keymap` was added 2 years ago to `help-fns.el` on the master branch but never made it to the 27 branch: check https://github.com/emacs-mirror/emacs/blob/emacs-27/lisp/help-fns.el. – Fran Burstall Aug 29 '21 at 23:07
  • @FranBurstall yeah, that's a long journey for such a useful command. Anyway, 28.1 is going to be released soon, so not so long to wait for those who uses the latest stable release. – Y. E. Aug 31 '21 at 12:36
  • @FranBurstall, I clarified in the answer when `describe-keymap` was/is introduced. I could have spotted the exact release sooner, answering your first comment (just looking at its `C-h f` output), but followed a more complex route :-). Thanks for your feedback. – Y. E. Aug 31 '21 at 13:00