Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to configure Emacs to start with two windows automatically, vertically split, and with the right side taking up ~60% of the total screen real estate?

share|improve this question
up vote 2 down vote accepted

If there is a way I bet you can find it on this page: Emacs Session Management

share|improve this answer
    
Great! It looks like this will do: emacswiki.org/emacs/WorkgroupsForWindows – Josh Jan 11 '11 at 17:36
    
(-1) that doesn't really answer the question – David LeBauer Dec 17 '11 at 20:34
    
I agree with David., Its better to write answer here on this page instead of linking to some where else. – kindahero Dec 19 '11 at 0:11

Assuming that you start with a window that is 80 columns by 50 columns, add this to your .emacs (from gnu.org):

  • To start with Horizontal split:

    (setq w (selected-window))
    (window-edges)
    (setq w2 (split-window w 15))
    (window-edges w2)
    (window-edges w)
    
  • To start with Vertical split (to get 60% on the right side, the width is set to 40 * (1 - 0.6) = 32

     (setq w (selected-window))
     (window-edges)
     (setq w2 (split-window w 32 t))
     (window-edges w2)
     (window-edges w)
    
share|improve this answer
    
this really answer the question. even though I would rather put all in a lambda and add it to init-hook – kindahero Dec 19 '11 at 0:13
    
@kindahero it does answer the original question, but only by copy and paste with minor modification. A better answer would explain what you mean by lambda and init-hook as well as what the code means and how it could be adapted (e.g. to open four windows instead of two). – David LeBauer Dec 19 '11 at 1:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .