Once upon a time, Choose Window (invoked by C-x C-b) used to always split the window vertically.

Starting from a certain Emacs version (I can't recall which one), that split is now either vertical or horizontal, depending on the containing windows aspect ratio.

Is there a way to force C-x C-b to always split vertically?

  • 1
    See emacs.stackexchange.com/q/17872/4068 for previous answers from bmag and Stefan for variables that modify emacs behaviour. Also stackoverflow.com/q/23659909/2911961 gives us "I can set split-height-threshold to nil to inhibit vertical split altogether" from Romain
    – p_wiersig
    Commented Nov 8, 2017 at 14:40
  • The attached link is invalid. Commented Nov 9, 2017 at 8:45
  • That "Choose Window" label is odd. By default, as C-h k C-x C-b will tell you, "C-x C-b runs the command list-buffers". Even taking into account that it's paraphrasing the commands, "Choose Window" doesn't make sense as a description for list-buffers
    – phils
    Commented Dec 9, 2017 at 11:26

2 Answers 2


You can overwrite that keybinding with a hack like that:

(global-set-key (kbd "C-x C-b")
                (lambda ()
                  (let ((display-buffer-overriding-action ;; force window
                           (inhibit-same-window . nil))))
                    (split-window-horizontally) ;; split window
                    (other-window 1) ;; change it

In general I prefer use ibuffer instead of list-buffers, but now is your call. Use whatever you think that is better :)

  • I put your solution in my .emacs but it now complains "Symbol's function definition is void: split-window-right". Is your solution version-specific?
    – datv
    Commented Nov 12, 2017 at 7:10
  • Maybe is if your emacs version is too old. Emacs currently is on version 27, I use 25.3. You can find the source of this function here: github.com/emacs-mirror/emacs/blob/… Commented Nov 13, 2017 at 2:20
  • You're right. I am still using version 23.2. I managed to copy the function to my .emacs and the horizontal splitting works perfectly. Vertical splitting works almost perfectly (when the vertical split occurs, the bottom window also splits horizontally).
    – datv
    Commented Nov 14, 2017 at 7:15
  • P.S. I can neither upvote nor accept answers since I don't have enough reputation.
    – datv
    Commented Nov 14, 2017 at 7:17
  • No problem at all, but I think you can accept answer yes. On my machine works perfectly the solution I attached here, probably the "almost" is something because the emacs version. Upgrade emacs is not a option for you use-case? Commented Nov 14, 2017 at 8:29

Credit - How to change the default split-screen direction?

The code below worked for me.

$ cat ~/.emacs
;; https://stackoverflow.com/questions/7997590/how-to-change-the-default-split-screen-direction
;; C-x C-b
;; splits the window vertically

;; Use (setq split-width-threshold nil) for vertical split.
;; Use (setq split-width-threshold 1 ) for horizontal split.
;; (setq split-width-threshold 1 )
(setq split-width-threshold nil)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.