3

I would like to set up Emacs to maximize (or specific size) and split my window horizontally into three equally sized frames on start up.

I have found other questions that are similar but not quite, Q1 and Q2.

Thank you.

EDIT: Maximize, not fullscreen.

Community
  • 1
  • 1
Niklas Hansson
  • 503
  • 2
  • 16

2 Answers2

6

To have equally sized windows you can use the command balance-windows (bound to C-x + for interactive use).

Nicolas Dudebout
  • 9,172
  • 2
  • 34
  • 43
1

Okay here is what I come up, There will be more elegant way to it. Nonetheless this does you want.

  (defun split-windows-even-3 ()
    "split into 3 evenly"
    (interactive)
    (save-excursion
      (let ((ps (window-width)))
        (split-window-horizontally (/ ps 3))
        (other-window 1)
        (split-window-horizontally (/ ps 3)))))

  ;;; ADD HOOKS to startup
  ;;  split three
  (add-hook 'emacs-startup-hook 'split-windows-even-3)

  ;; Fullscreen 
  (add-hook 'emacs-startup-hook (lambda ()
                                  (set-frame-parameter nil 'fullscreen 'fullboth)))

UPDATE: now its working emacs23 and emacs24

kindahero
  • 5,817
  • 3
  • 25
  • 32