My Mac has Emacs v22 and it only splits horizontally when I type ^x-2.

My Linux system has Emacs v24 and it splits vertically when Emacs thinks that's a better choice. The problem is, I don't want it to split that way. How do I prevent emacs from splitting vertically?

  • 1
    Odd as the manual shows C-x 2 (split-window-below). Look in the .emacs settings file or the customization interface and check if this has been re-assigned to split-window-right.
    – Brian
    Jul 18, 2013 at 1:58
  • Type C-h k C-x 2. Is the key properly set to split-window-below?
    – user235731
    Jul 18, 2013 at 9:58
  • The problem seems to show up with grep, compile, goto next error, and gdb commands.
    – vy32
    Jul 19, 2013 at 2:33

2 Answers 2


See the Emacs manual, node Window Choice. In particular, see user options split-height-threshold and split-width-threshold.

Specifically, add this to your .emacs file:

(setq split-width-threshold nil)

For splitting horizontally use C-x 3. You can find more options here.

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.