Evilify magit-diff and update README with new `SPC g d` binding

This commit is contained in:
syl20bnr 2015-06-15 21:55:57 -04:00
parent 70e7eb24d7
commit 9e6d6db6bd
2 changed files with 17 additions and 1 deletions

View File

@ -90,6 +90,7 @@ Git commands (start with ~=g~=):
|-------------+-----------------------------------------------------|
| ~SPC g b~ | open a =magit= blame |
| ~SPC g C~ | commit changes |
| ~SPC g d~ | show diff against current head |
| ~SPC g h c~ | clear highlights |
| ~SPC g h h~ | highlight regions by age of commits |
| ~SPC g h t~ | highlight regions by last updated time |

View File

@ -117,11 +117,17 @@
;; See: https://github.com/magit/magit/wiki/FAQ#windows-cannot-push-via-https
(when (eq window-system 'w32)
(setenv "GIT_ASKPASS" "git-gui--askpass"))
(defun spacemacs/magit-diff-head ()
"Execute `magit-diff' against current HEAD."
(interactive)
(magit-diff "HEAD"))
(evil-leader/set-key
"gb" 'magit-blame-mode
"gl" 'magit-log
"gs" 'magit-status
"gd" #'(lambda () (interactive) (magit-diff "HEAD"))
"gd" 'spacemacs/magit-diff-head
"gC" 'magit-commit)
(evilify magit-commit-mode magit-commit-mode-map
(kbd "C-j") 'magit-goto-next-section
@ -150,6 +156,15 @@
(kbd "C-p") 'magit-goto-previous-section
(kbd "C-v") 'magit-revert-item)
(evilify magit-status-mode magit-status-mode-map
"K" 'magit-discard-item
"L" 'magit-key-mode-popup-logging
"H" 'magit-key-mode-popup-diff-options
(kbd "C-j") 'magit-goto-next-section
(kbd "C-k") 'magit-goto-previous-section
(kbd "C-n") 'magit-goto-next-section
(kbd "C-p") 'magit-goto-previous-section
(kbd "C-v") 'magit-revert-item)
(evilify magit-diff-mode magit-diff-mode-map
"K" 'magit-discard-item
"L" 'magit-key-mode-popup-logging
"H" 'magit-key-mode-popup-diff-options