-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
magit-blame-quit keybinding #2171
Comments
You can alreayd quit with |
didn't work for me with develop branch |
Are you using Emacs or Vim editing style? |
I also have similar issue with magit-show-commit. (not mapped to RET) |
vim |
You can hit again |
It would be nice to have a keybinding to do recursive blame. ( I had previously used magit-blame, instead of magit-blame-mode, so repeating SPC g b made it recursive blame). Also at any blame commit, it would be nice to be able to see the full detail of the commit. The blame-mode had that mapped to RET. At any point we want to go back to previous blame state (mapped to 'q' by magit-blame-mode), magit-blame-quit. |
@jenanwise are you using the vim editing style. With vim style for me neither 'q' and 'RET' is magit features (which is expected). I was expecting them to remapped based on evilify logic. |
btw magit-blame-mode is a minor-mode for cc-mode and my earlier attempt to use evil directly required me to do the below hack (evil-define-key 'normal magit-blame-mode-map (kbd "q") 'magit-blame-quit) (add-hook 'magit-blame-mode-hook Not sure about spacemacs. |
@kvaneesh Vim mode, yes. As of current develop and latest evil, I have to have these in my config:
|
@jenanwise , I was not able to add the hook in .spacemacs (It gave error w.r.t magit-blame-mode-map). I could add them to git/packages.el and everything works as you mentioned above. Now shouldn't this hook and overriding-map be part of spacemacs git/package.el ? |
@kvaneesh Yes you'll have to guard it in something like
I'm not familiar enough with the inner workings of evil or emacs keymaps to know whether these should be added to the layer or not. Neither There is an active thread in magit/magit#1968 about evil integration with magit. Maybe that will solve our problems? |
It's easy enough to enter evilified state automatically: (add-hook 'magit-blame-mode-hook 'evil-evilified-state) It's presumably a bigger challenge to return to the state you were in upon quitting. (defun spacemacs/pre-magit-blame-mode (&rest args)
(unless magit-blame-mode
(setq spacemacs--magit-blame-initial-state evil-state)))
(defun spacemacs/post-magit-blame-mode (&rest args)
(if magit-blame-mode
(evil-evilified-state)
(funcall (intern (format "evil-%s-state" spacemacs--magit-blame-initial-state)))))
(advice-add 'magit-blame-mode :before 'spacemacs/pre-magit-blame-mode)
(advice-add 'magit-blame-mode :after 'spacemacs/post-magit-blame-mode) It's simpler just to return to normal state, maybe. (add-hook 'magit-blame-mode 'evil-evilified-state)
(defun spacemacs/post-magit-blame-mode (&rest args)
(unless magit-blame-mode (evil-normal-state)))
(advice-add 'magit-blame-mode :after 'spacemacs/post-magit-blame-mode) I haven't tested any of these snippets. Maybe @syl20bnr has seen this minor/major/evilified mode problem before? |
Any movement on this? You used to be able to do EDIT: Looks like this is the desired behavior - it blames father back each time you press it. What about binding |
This will have to do until they fix syl20bnr/spacemacs#2171
I'd like to see this fixed as well. I frequently use |
I've just been putting this in my ;; Bind SPC g B to `magit-blame-quit'
(evil-leader/set-key "gB" 'magit-blame-quit) Also just submitted a PR. I realize that it's probably not the best solution (to me, the best solution would be to make |
This will have to do until they fix syl20bnr/spacemacs#2171
This will have to do until they fix syl20bnr/spacemacs#2171
What should be the key binding for magit-blame-quit
The text was updated successfully, but these errors were encountered: