Skip to content

Instantly share code, notes, and snippets.

@bmag
Created July 7, 2016 09:32
Show Gist options
  • Save bmag/7173176d23ad918ee24ea75e33b44900 to your computer and use it in GitHub Desktop.
Save bmag/7173176d23ad918ee24ea75e33b44900 to your computer and use it in GitHub Desktop.
Display buffer in split of right window
(defun display-buffer-in-right-split (buffer alist)
(let ((right-window (car (window-at-side-list nil 'right))))
(when right-window
(let ((new-window (split-window right-window nil 'below)))
(window--display-buffer buffer new-window 'window alist)))))
(defun switch-buffer-split-right (buffer)
(interactive)
(pop-to-buffer buffer '(display-buffer-in-right-split)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment