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

ESC should close the Magit popup window #14

Closed seschwar closed 8 years ago

seschwar commented 8 years ago

Hitting ESC to close or get out of everything is a Vim habit I find hard to get rid of. Currently ESC does not close the Magit popup, but acts as a prefix key instead. It would be nice if simply hitting ESC closed the popup window.

justbur commented 8 years ago

Good idea. Added in 28ebfa3bb9e6f3cbea7e9d98cced91b2e0f76722

I also made it act as "q" in magit mode buffers (in normal state) for consistency. If you think that's wrong or think it needs to be other places, let me know.

thekondr commented 8 years ago

Now bound [escape] makes all meta keybindings undefined (for example, M-1, M-x, M-p, M-w) inside magit status and magit popup.

justbur commented 8 years ago

@thekondr fixed with https://github.com/justbur/evil-magit/commit/f10cd2c57a2bfcefdce3983bed717759442477b8

thekondr commented 8 years ago

@justbur thanks a lot!

nickstares commented 5 years ago

I'd like to prevent this from happening as per my question on SO: https://emacs.stackexchange.com/questions/45976/prevent-any-form-of-esc-from-closing-a-magit-buffer How can I do so?

justbur commented 5 years ago

After loading evil-magit, try

(evil-define-key* evil-magit-state magit-mode-map [escape] nil)
ambihelical commented 5 years ago

Above comment should be added to the README. I almost added a new bug for this.

justbur commented 5 years ago

@ambihelical done

JJPandari commented 4 years ago

Not exactly this issue's topic but similar: I've been upset when <escape> doesn't close the magit transient menu (triggered by ?) like C-g does. Just found magit uses transient.el and the problem is transient.el doesn't bind <escape> by default (it binds ESC but in my GUI Emacs the key is spelled <escape>):

(general-define-key
   :keymaps 'transient-base-map
   "<escape>" 'transient-quit-one)

(I like general.el but sure you can also use define-key here)