8

How do I split my windows on startup like so:

_____________
|  A  |  B  |
|_____|_____|
|     C     |
|___________|
  • Have a look to the "Grid Layout" wiki article, split the window 2x2 and close the lower right one – csantosb Nov 15 '14 at 23:59
  • As you become more acquainted with Emacs, you may wish to consider displaying certain buffers and creating the window layout simultaneously -- e.g., one could be shell, one could be your todo list, and one could be a calendar. – lawlist Nov 16 '14 at 18:42
  • 1
    Did I answer your question? Because if not, feel free to tell me. – Luke Dec 4 '14 at 22:56
  • @KingShimkus Yes you did, I simply forgot to check the checkmark. Thanks for reminding me – Asad-ullah Khan Dec 5 '14 at 0:55
11

Put the following code in your .emacs file:

(split-window-below)
(split-window-right)

Another option that you can add to your .emacs file is:

(split-window-vertically)
(split-window-horizontally)
  • Nope, this does not work. It puts a a large window on the right, and smaller one on the bottom – Asad-ullah Khan Nov 15 '14 at 21:26
  • Try switching the two commands. – Ryan Nov 15 '14 at 21:54
  • Why would I switch the commands? – Luke Nov 15 '14 at 22:10
  • @KingShimkus because the first split splits the entire window, while all subsequent splits split just the current buffer. Try it out and you will see the difference – Asad-ullah Khan Nov 16 '14 at 0:31
  • 1
    When I manually run these functions, I get a different result than when I put them in the init file. Do I need to delay the execution somehow? – Zelphir Kaltstahl Mar 22 '17 at 10:29
5

An alternative, which offers far more than you require, is to use workgroups.el. It will open Emacs in any of several definable configurations, let you switch among them and load the files you require. When you are doing development which requires several files open at once, it enables you to start working much faster. I use it a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.