(when (string-match "code" default-directory) (magit-status) (delete-other-windows)) (with-eval-after-load 'magit (define-key magit-status-mode-map (kbd "q") 'save-buffers-kill-terminal))