Mac – emacs – automatically split frames on creation

emacs

I almost always use Emacs in a one-frame, two-window configuration (that is, one OS window with two Emacs windows inside it). I have the default-frame-alist set so that frames appear at the right size, but then I have to manually split them (with C-x 3). Is there a way to tell Emacs to do that automatically when each new frame is created?

EDIT: If I do happen to create a new frame at some point, I want it to be split vertically as well. Therefore, (when window-system (split-window-horizontally)) in .emacs won't do the job, because it only applies to the initial frame. What I think I need is a hook that runs in the context of each new frame after the default-frame-alist is applied.

Best Answer

Just add

(split-window-horizontally)

to your .emacs file.

With C-h k you can check which Emacs function is linked to your shortcut. It's very useful if you are not familiar good enough with Emacs functions.

Related Question