| 1 |
# discover-my-major |
| 2 |
|
| 3 |
Discover key bindings and descriptions for commands defined by a buffer's major and minor modes. |
| 4 |
|
| 5 |
The command is inspired by [discover.el](https://github.com/mickeynp/discover.el) and also uses the [makey library](https://github.com/mickeynp/makey). I thought, "Hey! Why not parse the information about the major mode bindings somehow and display that like `discover.el` does..." |
| 6 |
|
| 7 |
The output is pretty bare bones and not optimized but it seems to work already quite well for most modes: |
| 8 |
|
| 9 |
 |
| 10 |
|
| 11 |
 |
| 12 |
|
| 13 |
## Installation |
| 14 |
|
| 15 |
### quelpa |
| 16 |
|
| 17 |
`quelpa` is at https://github.com/quelpa/quelpa |
| 18 |
|
| 19 |
```lisp |
| 20 |
(quelpa '(discover-my-major :fetcher git :url "https://framagit.org/steckerhalter/discover-my-major.git")) |
| 21 |
``` |
| 22 |
|
| 23 |
### MELPA |
| 24 |
|
| 25 |
Packages are available in [MELPA](http://melpa.milkbox.net/). |
| 26 |
|
| 27 |
### el-get |
| 28 |
|
| 29 |
```lisp |
| 30 |
(:name discover-my-major |
| 31 |
:type git |
| 32 |
:url "https://framagit.org/steckerhalter/discover-my-major") |
| 33 |
``` |
| 34 |
|
| 35 |
## Usage |
| 36 |
|
| 37 |
In any mode you should be able to summon the popup to discover the commands defined by the current buffer's `major-mode`, by invoking `M-x discover-my-major`; and for any of the buffer's active minor modes, by invoking `M-x discover-my-mode`. Each of these commands which will show you a list of key bindings defined by that mode in the current buffer along with their descriptions. |
| 38 |
|
| 39 |
The recommended key binding is `C-h C-m`, but be aware that by default `C-h C-m` is bound to `view-order-manuals`. If the `help+` package is installed, this key is bound to `help-on-click/key` by default. |
| 40 |
|
| 41 |
```lisp |
| 42 |
(global-set-key (kbd "C-h C-m") 'discover-my-major) |
| 43 |
(global-set-key (kbd "C-h M-m") 'discover-my-mode) |
| 44 |
``` |
| 45 |
|
| 46 |
Or alternatively, to avoid overriding `C-h C-m`: |
| 47 |
|
| 48 |
```lisp |
| 49 |
(global-set-key (kbd "C-h M-m") 'discover-my-major) |
| 50 |
(global-set-key (kbd "C-h M-S-M") 'discover-my-mode) |
| 51 |
``` |