How to open magit-status in full window

(setq magit-status-buffer-switch-function 'switch-to-buffer)

or via customize:

M-x customize-variable RET magit-status-buffer-switch-function RET


This solution has the advantage that you can kill the fullscreen buffer in quit-window style:

(defadvice magit-status (around magit-fullscreen activate)
  (window-configuration-to-register :magit-fullscreen)
  ad-do-it
  (delete-other-windows))

(defadvice magit-mode-quit-window (after magit-restore-screen activate)
  "Restores the previous window configuration and kills the magit buffer"
  (jump-to-register :magit-fullscreen))

(define-key magit-status-mode-map (kbd "q") 'magit-mode-quit-window)

If you have an older version of magit then you might need to rename magit-mode-quit-window to magit-quit-window.


For newer versions of Magit you can use this sanctioned snippet:

(setq magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1)

I combine it with this to get a zen-like full window Git status after switching projects:

(setq projectile-switch-project-action 'magit-status)


Here is another way to achieve this:

(add-to-list 'same-window-regexps "\*magit: .*\*")

Tags:

Emacs

Magit