tags:

views:

85

answers:

2

How can I make vertical splitting the default instead of horizontal splitting in Emacs?

My use case: I want to compare a Python file with an older revision of itself from the svn-repository, I do this with the C-x v ~ command. Unfortunately this always opens a second buffer while splitting the window horizontally. Vertically would be much better (at least for PEP-8 compliant files ;)).

A: 

Mine does open vertically when I try it. I don't have any experience with that particular command, but if it's like most emacs commands it decides which way to split the window based on the current window dimensions: if the window is tall it will split horizontally, but if it's wide it will split vertically. So just change the window dimensions to be wider and it should switch automatically

Michael Mrozek
Thanks for the answer, but resizing the window as you suggested didn't help.
jellybean
+1  A: 

See the answers to the question Setting Emacs Split to Horizontal and do the opposite.

Taking offby1's answer and inverting it gives you:

(setq split-height-threshold 0)
(setq split-width-threshold nil)
Trey Jackson
Cool! I searched, but didn't find that question. Thanks!
jellybean
@jellybean Yup, I think that's enough reason for the question not to be marked as a duplicate.
Trey Jackson