emacs init: Set Default Window (frame) Size

By Xah Lee. Date: . Last updated: .

Set Default Window (Emacs Frame) Size

Put this in your Emacs Init File:

;; make the initial frame positioned at the top of screen
(push '(top . 0) initial-frame-alist)
(push '(left . 400) initial-frame-alist)

;; set width and height of any new window
(push '(width . 80) default-frame-alist)
(push '(height . 44) default-frame-alist)

;; remove the big ugly tool bar
(push '(tool-bar-lines . 0) default-frame-alist)

another way to do it

(modify-all-frames-parameters
 '((tool-bar-lines . 0)
   (width . 80)
   (height . 44)))
initial-frame-alist
  • Variable.
  • Config for the first window emacs starts with.
  • Value is a Association List.

see emacs lisp manual for detail.

[see Emacs: Show Variable Value and Doc]

default-frame-alist

see emacs lisp manual for detail.

Reference

Emacs init, set default window size, etc