Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open new Emacs buffer using vertical splitting

Tags:

emacs

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

like image 651
Johannes Charra Avatar asked Aug 02 '10 15:08

Johannes Charra


People also ask

How do I split a window vertically in Emacs?

You can split a window horizontally or vertically by clicking C-Mouse-2 in the mode line or the scroll bar.

How do I switch between buffers in Emacs?

To move between the buffers, type C-x b. Emacs shows you a default buffer name. Press Enter if that's the buffer you want, or type the first few characters of the correct buffer name and press Tab. Emacs fills in the rest of the name.

How do I split in Emacs?

Depending on how Emacs is compiled, you can also split a window by clicking C-mouse-2 in the scroll bar, which puts a horizontal divider where you click (this feature does not work when Emacs uses GTK+ scroll bars).

How do I open a new window in Emacs?

To open a new frame, select Make New Frame from the Files menu or press C-x 5 2 (for make-frame). Emacs makes a new frame containing the current buffer and puts it on top of the current frame. These lines set up sizes for the width and height of Emacs frames.


1 Answers

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)
like image 151
Trey Jackson Avatar answered Oct 31 '22 13:10

Trey Jackson