emacs-evil / evil-magit

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

evil-magit/magit overriding general.el keybindings #73

Closed hmgibson23 closed 4 years ago

hmgibson23 commented 4 years ago

I set a bunch of keybindings with general.el, especially around SPC. This is done with use-package but evil-magit or possibly magit is overriding them.

For example:

(use-package general
:after evil
:config
  (general-create-definer spc-leader
    :prefix "SPC")

  (spc-leader
    :states 'motion
    :keymaps 'override
    :prefix-map 'spc-leader-map
    "ff" 'counsel-find-file))

The :keymaps override is meant to prevent other modes from overriding it, so I'd expect that Magit would not use SPC to show the diff. However when I press SPC in a magit buffer it shows the diff.

I appreciate this could be the fault of general but the issue only seems to occur inside magit buffers.

Any help appreciated.

vyp commented 4 years ago

Can you try (general-override-mode) at the beginning of :config? I know it's supposed to activate automatically when general sees an override keymap, but I had a similar issue and manually activating general-override-mode fixed it.

hmgibson23 commented 4 years ago

Just tried it in :init and :config and it made no difference. Guess it could be to do with order of package loads but that would be a general thing.

vyp commented 4 years ago

Ah maybe try placing general use-package form before evil, and removing :after evil?

hmgibson23 commented 4 years ago

Same problem. I will make an issue in the general.el repo because it seems like this is more to do with that than evil-magit

vyp commented 4 years ago

For reference: https://github.com/noctuid/general.el/issues/171

@hmgibson23 can you close this as well, ty.

hmgibson23 commented 4 years ago

Yup. Thanks again.