tools/magit: minor refactor; clean up buffers after quitting magit #506

This commit is contained in:
Henrik Lissner 2018-04-04 07:18:37 -04:00
parent 2ce6549e98
commit 17a3008493
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -11,19 +11,11 @@
#'magit-builtin-completing-read) #'magit-builtin-completing-read)
magit-revision-show-gravatars '("^Author: " . "^Commit: ")) magit-revision-show-gravatars '("^Author: " . "^Commit: "))
(set! :popup "^\\*?magit" :ignore) (add-hook 'magit-popup-mode-hook #'hide-mode-line-mode)
(set! :popup "^\\(?:\\*magit\\|magit:\\)" :ignore)
;; (add-hook 'magit-popup-mode-hook #'hide-mode-line-mode) ;; Clean up after magit by properly killing buffers
;; (set! :popup "^.*magit" '((slot . -1) (side . right) (size . 80)) '((modeline . nil) (select . t))) (setq magit-bury-buffer-function #'+magit/quit)
;; (set! :popup "^\\*magit.*popup\\*" '((slot . 0) (side . right)) '((modeline . nil) (select . t))) (map! :map magit-mode-map [remap quit-window] #'+magit/quit))
;; (set! :popup "^.*magit-revision:.*" '((slot . 2) (side . right) (window-height . 0.6)) '((modeline . nil) (select . t)))
;; (set! :popup "^.*magit-diff:.*" '((slot . 2) (side . right) (window-height . 0.6)) '((modeline . nil) (select . nil)))
(after! evil
;; Switch to emacs state only while in `magit-blame-mode', then back when
;; its done (since it's a minor-mode).
(add-hook! 'magit-blame-mode-hook
(evil-local-mode (if magit-blame-mode -1 +1)))))
(def-package! magit-blame (def-package! magit-blame
@ -48,4 +40,9 @@
:when (featurep! :feature evil) :when (featurep! :feature evil)
:after magit :after magit
:config :config
(setq evil-magit-state 'normal)) (setq evil-magit-state 'normal)
;; Switch to emacs state only while in `magit-blame-mode', then back when
;; its done (since it's a minor-mode).
(add-hook! 'magit-blame-mode-hook
(evil-local-mode (if magit-blame-mode -1 +1))))