6
votes

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 ;)).

2

2 Answers

7
votes

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)
0
votes

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