ChrisR
ChrisR

Reputation: 1237

Emacs window positioning

maybe this is stupid question.. but i'm trying to get my emacs customization fine grained.. is there a direct command to change windows like this?

+----------------+
|                |    
|                |
+----------------+
|                |
|                |
+----------------+

to

+----------------+------------+
|                |            |
|                |            |
+----------------+            |
|                |            |
|                |            |
+----------------+------------+

or am i going to need to start learning elisp?

Upvotes: 1

Views: 461

Answers (2)

user7711283
user7711283

Reputation:

The right answer to your question is to use a not in Emacs user documentation index of available commands mentioned way of creating a new window. Below the direct command you are looking for:

    M-x split-root-window-right

That's it. The ROOT versions of the split-window-right and split-window-below create new windows spanned over the entire height and width.

The only limitation here is that you can't create a new window above or on the left side, so if you need for example a left window spanning over the entire height you have to create it before you split the other windows. Else you have to un-split the other windows and re-create them in a new window created on the right side.

Upvotes: 0

elbeardmorez
elbeardmorez

Reputation: 590

yes you will, but toying with window layout and buffers is very good place to start. here's a solution for you, it gives you most of what you need to customise your layouts.

add the code below to your .emacs. C-x C-e to evaluate it, then hopefully hitting F5 will do as you expect (provided you haven't killed the '*Messages*' buffer).

global-set-key '[f5] '(lambda () (interactive)             
                        (let ((other (buffer-name (window-buffer (next-window)))))
                        (delete-other-windows)
                    (set-frame-width (selected-frame)
                    (+ (frame-width (selected-frame)) (window-width)))
                    (split-window-horizontally)
                    (split-window-vertically)
                    (with-selected-window (next-window)
                       (set-window-buffer (selected-window) other))
                    (with-selected-window (previous-window) 
                       (set-window-buffer (selected-window) "*Messages*")))))

Upvotes: 5

Related Questions