From fd1b1a7316ae8a9fa4e1aa0110317b75a319aa20 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 24 May 2016 20:06:59 -0700 Subject: [emacs] open magit in full screen. I prefer to have magit in full screen instead of having a new buffer to pop up. --- emacs.d/core/core-git.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/emacs.d/core/core-git.el b/emacs.d/core/core-git.el index 7044367..a695def 100644 --- a/emacs.d/core/core-git.el +++ b/emacs.d/core/core-git.el @@ -25,7 +25,22 @@ :ensure t :defer t) -(provide 'core-git) +;; run magit in full screen +;; http://www.lunaryorn.com/2016/04/28/fullscreen-magit-status.html +(add-to-list 'display-buffer-alist + `(,(rx "*magit: ") + (fcuny/display-buffer-fullframe) + (reusable-frames . nil))) + +(defun fcuny/display-buffer-fullframe (buffer alist) + "Display BUFFER in fullscreen. +ALIST is a `display-buffer' ALIST. +Return the new window for BUFFER." + (let ((window (display-buffer-pop-up-window buffer alist))) + (when window + (delete-other-windows window)) + window)) +(provide 'core-git) -- cgit 1.4.1