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

h and l are incorrectly bound if evil-magit is loaded lazily #32

Open sooheon opened 7 years ago

sooheon commented 7 years ago

If I use :after magit in the evil-magit use-package decl. to defer loading, h and l keys move cursor regardless of the value of evil-magit-want-horizontal-movement. I found that I have to not defer evil-magit at all in order to fix this issue.

;; This setting causes h/l to move cursor in magit buffers
(use-package magit
  :config
  (setq magit-popup-show-common-commands nil))

(use-package evil-magit
  :after magit
  :init
  (add-hook 'magit-mode-hook 'turn-off-evil-snipe-override-mode)
  (setq evil-magit-want-horizontal-movement nil))
justbur commented 7 years ago

Can you take out the general stuff in your example? I keep getting errors (about general, nvmap, etc) trying to use your example.

sooheon commented 7 years ago

Updated, general is just a key binding package, you can still check by manually calling magit-status.

justbur commented 7 years ago

Hm, I can't reproduce this. I just tried this from emacs -Q and everything seems fine with h and l

(package-initialize)

(use-package magit
  :config
  (setq magit-popup-show-common-commands nil))

(use-package evil-magit
  :after magit
  :init
  (setq evil-magit-want-horizontal-movement nil))

(evil-mode)
ambihelical commented 6 years ago

:after doesn't actually defer loading, at least in the use-package sense, it imposes an ordering. In fact if you have use-package-always-defer set, the behavior may be that evil-magit doesn't load at all at least with the config the OP has. The use-package site has this warning:

Note: Pay attention if you set use-package-always-defer to t, and also use the :after keyword, as you will need to specify how the declared package is to be loaded: e.g., by some :bind. If you're not using one of tho mechanisms that registers autoloads, such as :bind or :hook, and your package manager does not provide autoloads, it's possible that without adding :demand t to those declarations, your package will never be loaded.