Emacs rearrange split panes

emacs

Solution

If you like pre-set window configurations, take a look at the "workspace management" pakages:

- Perspective gives you named workspaces

- Equilibrium Emacs Window Manager is similar but more sophisticated tool which allows to configure popup placement, window configuraion, buffers, fonts and keybindings.

There is more on the project management page on EmacsWiki.

To your second question, here is what I have in my configuration to flip horizontal/vertical splits (credit: https://github.com/yyr/emacs.d):

(defun split-window-func-with-other-buffer (split-function)
  (lexical-let ((s-f split-function))
    (lambda ()
      (interactive)
      (funcall s-f)
      (set-window-buffer (next-window) (other-buffer)))))

(defun split-window-horizontally-instead ()
  (interactive)
  (save-excursion
    (delete-other-windows)
    (funcall (split-window-func-with-other-buffer 'split-window-horizontally))))

(defun split-window-vertically-instead ()
  (interactive)
  (save-excursion
    (delete-other-windows)
    (funcall (split-window-func-with-other-buffer 'split-window-vertically))))

(global-set-key "\C-x|" 'split-window-horizontally-instead)
(global-set-key "\C-x_" 'split-window-vertically-instead)

Problem

If I'm working in (terminal) Emacs and have 2 buffers on screen using a horizontal split: ``` +--------------------------+ | | | | | | | | +--------------------------+ | | | | | | | | +--------------------------+ ``` Then I decide to open the slime repl, Emacs will split one of those horizontal panes vertically: ``` +--------------------------+ | | | | | | | | +-------------+------------+ | | | | | slime | | | | | | | +-------------+------------+ ``` But what I want is to have slime on the right, using the full height of the window: ``` +-------------+------------+ | | | | | | | | | | | | +-------------+ slime | | | | | | | | | | | | | +-------------+------------+ ``` Is there any easy way to get from the arrangement Emacs automatically gave me, to the one I want (e.g. a rotate arrangement), or do I explicitly close and re-split the windows myself? EDIT | Also curious if I can directly open a full vertical split if I'm currently using a full horizontal split, or if it's effectively impossible.

Original source