Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Trasient maps support #307

Open
Ergus opened this issue Jun 17, 2021 · 5 comments
Open

Trasient maps support #307

Ergus opened this issue Jun 17, 2021 · 5 comments

Comments

@Ergus
Copy link

Ergus commented Jun 17, 2021

Hi:

I am wondering whether is it something available to provide some support for transient-maps. I mean; is it possible to show some hints with which-key when a transient-map is active?

@justbur
Copy link
Owner

justbur commented Jun 20, 2021

Isn't the point of transient maps to show you the available key bindings? Are you talking about this package?

@Ergus
Copy link
Author

Ergus commented Jun 20, 2021

Are you talking about this package?

No, I was referring to the set-transient-map function: https://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html

@Ergus
Copy link
Author

Ergus commented Jun 20, 2021

The only package that offers more or less a similar functionality is hydra... but it is a little bit too much for basic uses and to go into vanilla as which-keys is expected to do hopefully very soon.

@trev-dev
Copy link

Just chiming in here. I've set myself up with a command to activate a sparse keymap via (set-transient-keymap) and which-key does not activate. Just wanna throw my name in the bucket of people who might care about this.

(defvar er/keymap
  (let ((map (make-sparse-keymap "er/objects")))
    (td/bind-keys '(("w" . er/mark-word)
                    ("W" . er/mark-symbol)
                    ("s" . er/mark-sentence)
                    ("p" . er/mark-paragraph)
                    ("b" . er/mark-block)
                    ("e" . er/mark-email)
                    ("u" . er/mark-url)
                    ("o" . er/mark-org-element)
                    ("O" . er/mark-org-parent))
                  map)
    map)
  "A keymap for quickly calling expand region functions.
\\{er/keymap}")

(defun er/keymap ()
  "Activate the `er/keymap'.
\\{er/keymap}"
  (interactive)
  (set-transient-map er/keymap))

@KhalfaniW
Copy link

Hercules was built to use which-key for transient states.

It's like hydra but it doesn't require the significant amount of setup.
https://github.com/wurosh/hercules

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants