2d75e4e5f0cc87fa40683fa0adba9582707a91d1 — Elais Player 3 years ago 7ac7ace
use doom-emacs magit buffer function

I was spoiled by this behavior that was introduced to doom, so I
decided to co-opt it for my own config. Thank you Henrik.
2 files changed, 37 insertions(+), 2 deletions(-)

M init.el
M lisp/shao-vc.el
M init.el => init.el +1 -1
@@ 33,7 33,7 @@
  (setq tao-theme-use-sepia nil)
  (load-theme 'white t))
  (load-theme 'tao-yang t))
;; Credentials  
(setq user-name "Elais Player"

M lisp/shao-vc.el => lisp/shao-vc.el +36 -1
@@ 1,7 1,42 @@
;;; shao-vc.el -*- lexical-binding: t; -*-

;; stolen from doom-emacs
(defun +magit-display-buffer-fn (buffer)
  "Same as `magit-display-buffer-traditional', except...
- If opened from a commit window, it will open below it.
- Magit process windows are always opened in small windows below the current.
- Everything else will reuse the same window."
  (let ((buffer-mode (buffer-local-value 'major-mode buffer)))
     buffer (cond
             ((and (eq buffer-mode 'magit-status-mode)
                   (get-buffer-window buffer))
             ;; Any magit buffers opened from a commit window should open below
             ;; it. Also open magit process windows below.
             ((or (bound-and-true-p git-commit-mode)
                  (eq buffer-mode 'magit-process-mode))
              (let ((size (if (eq buffer-mode 'magit-process-mode)
                  . ((window-height . ,(truncate (* (window-height) size)))))))

             ;; Everything else should reuse the current window.
             ((or (not (derived-mode-p 'magit-mode))
                  (not (memq (with-current-buffer buffer major-mode)

(use-package magit
  ("C-x g" 'magit-status))
  ("C-x g" 'magit-status)
  (setq magit-display-buffer-function #'+magit-display-buffer-fn))

(provide 'shao-vc)