Created
June 13, 2018 16:12
-
-
Save idcrook/6011fc29204b920ec00fc69be778d9dc to your computer and use it in GitHub Desktop.
Emacs magit-status kill associated buffers (instead of just burying)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; based on http://manuel-uberti.github.io/emacs/2018/02/17/magit-bury-buffer/ | |
;; had to deviate from it since: | |
;; 1. the post's key bind code did not work for me | |
;; 2. added late loading, otherwise magit-status-mode-map undefined | |
;; 3. 'q' was already bound by magit, so use 'Q' instead of rebinding | |
(defun idc-magit-kill-buffers () | |
"Restore window configuration and kill all (of these) Magit buffers." | |
(interactive) | |
(let ((buffers (magit-mode-get-buffers))) | |
(magit-restore-window-configuration) | |
(mapc #'kill-buffer buffers))) | |
(eval-after-load "magit" | |
'(define-key magit-status-mode-map (kbd "Q") #'idc-magit-kill-buffers)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment