vcs: add git-messenger and magit plugins
This commit is contained in:
parent
81854c2a9f
commit
10d309571b
2 changed files with 40 additions and 4 deletions
|
@ -26,10 +26,13 @@
|
||||||
("*esup*" :align below :size 30 :noselect t)
|
("*esup*" :align below :size 30 :noselect t)
|
||||||
("*ert*" :align below :size 20 :noselect t)
|
("*ert*" :align below :size 20 :noselect t)
|
||||||
;; vcs
|
;; vcs
|
||||||
("^\\*git-gutter.+\\*$" :align below :size 0.4 :noselect t :regexp t)
|
("*git-messenger*" :align left :size 55 :select t)
|
||||||
("*vc-diff*" :align below :size 0.4 :noselect t)
|
("^\\*git-gutter.+\\*$" :align below :size 15 :noselect t :regexp t)
|
||||||
("*vc-change-log*" :align below :select t)
|
("*vc-diff*" :align below :size 15 :noselect t)
|
||||||
|
("*vc-change-log*" :align below :size 15 :select t)
|
||||||
(vc-annotate-mode :same t)
|
(vc-annotate-mode :same t)
|
||||||
|
((:custom (lambda (b &rest _) (derived-mode-p 'magit-mode)))
|
||||||
|
:align below :size 0.5)
|
||||||
;; Util
|
;; Util
|
||||||
("*Apropos*" :align below :size 0.3)
|
("*Apropos*" :align below :size 0.3)
|
||||||
("*minor-modes*" :align below :size 0.5 :noselect t)
|
("*minor-modes*" :align below :size 0.5 :noselect t)
|
||||||
|
@ -94,6 +97,21 @@
|
||||||
;; Hacks
|
;; Hacks
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defun doom-load-magit-hacks ()
|
||||||
|
;; Some wrassling must be done to get magit to kill itself, and trigger my
|
||||||
|
;; shackle popup hooks.
|
||||||
|
(setq magit-bury-buffer-function
|
||||||
|
(lambda (&rest _) (doom/popup-close (selected-window)))
|
||||||
|
magit-display-buffer-function
|
||||||
|
(lambda (b)
|
||||||
|
(funcall (if (doom/popup-p (selected-window)) 'switch-to-buffer 'doom/popup-buffer) b)
|
||||||
|
(get-buffer-window b))
|
||||||
|
magit-display-file-buffer-function
|
||||||
|
(lambda (b)
|
||||||
|
(when doom-prev-buffer
|
||||||
|
(select-window (get-buffer-window doom-prev-buffer)))
|
||||||
|
(switch-to-buffer b))))
|
||||||
|
|
||||||
(after! help-mode
|
(after! help-mode
|
||||||
;; So that help buffer links do not open in the help popup, we need to redefine these
|
;; So that help buffer links do not open in the help popup, we need to redefine these
|
||||||
;; three button types to use `switch-to-buffer' rather than `pop-to-buffer'.
|
;; three button types to use `switch-to-buffer' rather than `pop-to-buffer'.
|
||||||
|
|
|
@ -37,6 +37,24 @@
|
||||||
(defalias 'doom/vcs-stage-hunk 'git-gutter:stage-hunk)
|
(defalias 'doom/vcs-stage-hunk 'git-gutter:stage-hunk)
|
||||||
(defalias 'doom/vcs-revert-hunk 'git-gutter:revert-hunk))
|
(defalias 'doom/vcs-revert-hunk 'git-gutter:revert-hunk))
|
||||||
|
|
||||||
|
(use-package git-messenger
|
||||||
|
:commands git-messenger:popup-message
|
||||||
|
:init (defvar git-messenger-map (make-sparse-keymap))
|
||||||
|
:config
|
||||||
|
(setq git-messenger:show-detail t)
|
||||||
|
(map! :map git-messenger-map
|
||||||
|
"<escape>" 'git-messenger:popup-close
|
||||||
|
"q" 'git-messenger:popup-close))
|
||||||
|
|
||||||
|
(use-package magit
|
||||||
|
:commands (magit-status)
|
||||||
|
:config
|
||||||
|
(doom-load-magit-hacks)
|
||||||
|
(add-hook 'magit-mode-hook 'turn-off-evil-snipe-override-mode))
|
||||||
|
(use-package evil-magit
|
||||||
|
:after magit
|
||||||
|
:config (evil-set-initial-state 'magit-popup-mode 'normal))
|
||||||
|
|
||||||
(after! vc-annotate
|
(after! vc-annotate
|
||||||
(evil-set-initial-state 'vc-annotate-mode 'normal)
|
(evil-set-initial-state 'vc-annotate-mode 'normal)
|
||||||
(evil-set-initial-state 'vc-git-log-view-mode 'normal)
|
(evil-set-initial-state 'vc-git-log-view-mode 'normal)
|
||||||
|
@ -51,7 +69,7 @@
|
||||||
:n "RET" 'vc-annotate-find-revision-at-line))
|
:n "RET" 'vc-annotate-find-revision-at-line))
|
||||||
|
|
||||||
(use-package browse-at-remote
|
(use-package browse-at-remote
|
||||||
:commands (browse-at-remote/browse browse-at-remote/to-clipboard))
|
:commands (browse-at-remote/browse browse-at-remote/get-url))
|
||||||
|
|
||||||
(provide 'core-vcs)
|
(provide 'core-vcs)
|
||||||
;;; core-vcs.el ends here
|
;;; core-vcs.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue