Skip to content

Instantly share code, notes, and snippets.

@wandersoncferreira
Last active December 19, 2020 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wandersoncferreira/f2a1fa285e49b054be0234aa677bae0d to your computer and use it in GitHub Desktop.
Save wandersoncferreira/f2a1fa285e49b054be0234aa677bae0d to your computer and use it in GitHub Desktop.
Open magit-diff-buffer using other-window
(defun bk/magit-display-diff-other-window (buffer)
"Display BUFFER in same-window but for magit-diff use other-window instead."
(display-buffer
buffer (if (with-current-buffer buffer (derived-mode-p 'magit-diff-mode))
'(display-buffer-pop-up-window)
'(display-buffer-same-window))))
(setq magit-display-buffer-function
#'bk/magit-display-diff-other-window)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment