How do I convert horizontal split to vertical split and vice-versa in Emacs? Is there a command/recipe for this?
First split one of the windows in two Ctrl + X 3, then switch one of the two horizontal windows to the previous one (i.e. the other horizontal split): Ctrl + X b Enter. Not the answer you're looking for? Browse other questions tagged emacs or ask your own question.
As an alternative way to create a vertical split, you can press the Ctrl + w key combination, and lastly, press the letter " v " (v for vertical split). Vim allows you to split the window horizontally as well. To make a horizontal split, enter Normal mode, and run the following command:
In the mode line of a window, split that window. C-x 2 ( split-window-below) splits the selected window into two windows, one above the other. After splitting, the selected window is the upper one, and the newly split-off window is below.
When you split a window with C-x 3, each resulting window occupies less than the full width of the frame. If it becomes too narrow, the buffer may be difficult to read if continuation lines are in use (see Continuation Lines). Therefore, Emacs automatically switches to line truncation if the window width becomes narrower than 50 columns.
http://www.emacswiki.org/emacs/ToggleWindowSplit
a version that works for an arbitrary number of open windows
http://www.emacswiki.org/emacs/TransposeFrame
https://stackoverflow.com/a/8650787/324105
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With