emacs-evil / evil-magit

Black magic or evil keys for magit
https://github.com/justbur/evil-magit
GNU General Public License v3.0
273 stars 16 forks source link

Can we bind escape to quit the transient/popup windows #77

Closed ChoppinBlockParty closed 3 years ago

ChoppinBlockParty commented 4 years ago
       ;; NOTE This is now transient-map and the binding is C-g.
       ;; ((emacs) magit-popup-mode-map "<escape>" "q")

I see that with the new rework of popus (for what ever reason they decided to change it), escape is not working anymore, Is there a way to bring it back to work?

justbur commented 4 years ago

The simplest thing to do is

(define-key transient-map (kbd "<escape>") 'transient-quit-one)

but that affects all transient maps, so I don't want to add that to evil-magit. Of course, it's fine for you to add that to your configuration.

There doesn't seem to be an easy way of doing this for just the transient maps in magit, but I might look into this later

jappeace commented 3 years ago

Oh thank god for that config, you solved weeks of annoyance.

jappeace commented 3 years ago

I'm using this now:

(use-package evil-magit
  :after (magit evil)
  :config
  (define-key transient-map (kbd "<escape>") 'transient-quit-one)
  )

(For anyone else finding this issue).

rbugajewski commented 3 years ago

but that affects all transient maps, so I don't want to add that to evil-magit.

So the right thing to do would be to add evil-collection-transient to evil-collection and just rebind C-g to escape (for a first, fast version)?

I don’t understand the reasoning here, because it is quite obvious that Evil users don’t want to deal with C-g at all.

Or what would speak against an alternative solution where rebinding transient would happen only temporarily while magit buffers are active? Couldn’t this be done as part of evil-magit?