Install package fullframe then (fullframe magit-status magit-mode-quit-window)
Others: bind q to this function
```elisp
(defun eat/quit ()
"Delete current window switch to prevous buffer."
(interactive)
(if (> (seq-length (window-list (selected-frame))) 1)
(delete-window)
(previous-buffer)))
```