简体   繁体   中英

Open new Emacs buffer using vertical splitting

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

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM