I’m currently in mode: C-x 2
Normally, I don’t care much about vertical splitting. However, I’m coding on a 13″ display, which makes vertical space rather precious.
I would like some setup where when I do C-x 2, my window is not split 50/50, but rather 70/30 [this way I can send the repl to the bottom portion of the screen, and stll see quite a bit of code.]
C-h a vertical split
brings up:
split-window-vertically, table-split-call-vertically
However, I suspect there is some parameter that changes / controls the split ratio.
What emacs option tells my computer to split 70/30 rather than 50/50?
Thanks!
You can use a prefix argument to tell Emacs how many lines to give each of the two windows.
See: C-hk C-x2
or C-hf
split-window-belowRETSo you could give the upper window 20 lines and the lower window the remainder with: C-u
20C-x2(or M-2M-0C-x2, etc…)
And you could give the lower window 10 lines and the upper window the remainder with: C-u
-10C-x2(or M--M-1M-0C-x2, etc…)
See How to change size of split screen emacs windows? for lots of ways to modify the size of windows after splitting.
Edit:
You can use the following function to do what you want:
The default ratio is 70/30, but you can supply a single-digit prefix argument to specify the size of the top window in 10% increments.
If you bound this command to C-x2 then C-9C-x2 would give the top window 90% and the bottom 10%.
Edit 2: I ended up using a variation of that as my own C-x2 binding. This version defaults to a normal 50/50 split, but provides the same prefix arg functionality of the other function in case I want something different.