[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rotate split windows
From: |
Markus Triska |
Subject: |
Re: rotate split windows |
Date: |
Mon, 04 Dec 2006 20:54:37 +0100 |
"wim yedema" <wim.yedema@gmail.com> writes:
> I would like to be able to "rotate" the split between windows, eg:
> from (A, B) vertical to (A, B) horizonal, to (B, A) vertical, to (B,
> A) horizontal, and the other way around. Can anyone tell me how to
> do this?
Add this to your .emacs:
(defun rotate-split ()
(interactive)
(let ((root (car (window-tree))))
(if (listp root)
(let* ((w1 (nth 2 root))
(w2 (nth 3 root))
(b1 (window-buffer w1))
(b2 (window-buffer w2)))
(cond ((car root) ; currently vertically split
(delete-window w2)
(set-window-buffer (split-window-horizontally) b2))
(t ; currently horizontally split
(delete-window w1)
(set-window-buffer (split-window-vertically) b1))))
(message "Root window not split"))))
and invoke it with M-x rotate-split.
You can add this:
(global-set-key [f9] 'rotate-split)
to bind it to the function key F9 (for example).
The clockwise direction is analogous.
All the best,
Markus Triska
- rotate split windows, wim yedema, 2006/12/04
- Re: rotate split windows,
Markus Triska <=
- Re: rotate split windows, Marco Wahl, 2006/12/05
- Re: rotate split windows, Chris Menzel, 2006/12/05
- Re: rotate split windows, Markus Triska, 2006/12/06
- Re: rotate split windows, Chris Menzel, 2006/12/06
- Re: rotate split windows, wim yedema, 2006/12/07
- Message not available
- Re: rotate split windows, Markus Triska, 2006/12/07