noctuid / evil-guide

Draft of a guide for using emacs with evil
GNU General Public License v3.0
1.26k stars 61 forks source link

[question] Is there any good replacement for evil-magit? #13

Closed BooAA closed 3 years ago

BooAA commented 6 years ago

As you mentioned that you don't use evil-magit in the article, what's your solution to use evil bindings for magit? (or even you don't use magit?).

I find that evil-collection doesn't provide bindings for magit(it just fix some trivial problem for evil-magit I think). However, evil-magit's bindings have some conflict with the idea "Make Evil Normal State the Initial State Always". Most of the time they bind key under normal state, but they are some "evil-magit-untouched-mode" , where they will not change the state of buffer to normal-state but use the default one (which is emacs-state for magit according to the default value of evil-emacs-state-modes).

This bothers me, since I do what you suggest to make all modes start in normal-state always(I agree this might be the simplest way to reduce the complexity of keybindings), but there will be some awkward situation when using evil-magit.

For example:

  1. M-x magit-status
  2. press s to stage some files
  3. press c to commit (than emacs will popup a buffer called magit-commit-popup, which is categorized as evil-magit-untouched-mode under evil-magit, so it will stay as what it originally should be.
  4. press c again to write commit message, (this steps crash)

Since magit-commit-popup use the keybindings of emacs-state, if we force it to start at normal-state, the second c will run evil-change but not magit-commit-create. This is really annoying. Of course we can push modes defined in evil-magit-untouched-mode back to emacs-state and all this works, but I prefer to find other more clean solution. I'm all ear to your solution to magit.

noctuid commented 3 years ago

Sorry I never responded. I just use my own custom keybindings for magit. We have transient now, and evil-magit has now been integrated with evil-collection, so I will close this issue. If there are issues with it, the evil-collection repo would be the best place to ask though I can answer any questions about my own setup.