From c77c08250bf48b574878fc66735e64d20fc4a156 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 1 Jun 2020 00:18:51 -0400 Subject: [PATCH] Add function to start magit in current window primarily for command line alias usage --- .emacs.d/init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 500ce74..dbf0b3a 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -473,7 +473,14 @@ (use-package magit :ensure :bind (("C-x g" . magit-status) (:map magit-status-mode-map (("i" . magit-gitignore-in-topdir) - ("I" . magit-gitignore-in-gitdir))))) + ("I" . magit-gitignore-in-gitdir)))) + :config + (defun magit-status-no-new-window (directory) + (interactive "D") + (progn (let ((magit-display-buffer-function + '(lambda (buffer) + (display-buffer buffer '(display-buffer-same-window))))) + (magit-status directory))))) (use-package popwin :ensure :disabled