Emacs is constantly making new windows and it's been ruining my day lately. How can I tell emacs to use the following policy when creating windows?
- Prefer vertical splits
- Stop doing vertical splits when windows would be less than 80 columns.
- Stop doing horizontal splits when window would be less than 60 rows.
- When I reach this 6x6 grid, on my 27" monitor, start reusing windows!
Also, I'd prefer my windows to always be balanced, but every split leaves the widow sizes unbalanced. I'd rather have 3 equally sized windows than 1 large and two which are too small! Is there a setting for this, or a sensible place to put a balance-windows advice?
display-buffer-alist
. Others just programmatically fix it after the fact -- e.g.,delete-window
andswitch-to-buffer
, split-vertically/horizontally, and so forth. And, there are some additional libraries to help manage the windows and/or revert back to the prior layout. I prefer the first option -- i.e., modify the source and make it absolutely perfect, but I am in the rare minority of people.split-height-threshold
andsplit-width-threshold
-- gnu.org/software/emacs/manual/html_node/emacs/…display-buffer-alist
. Seedisplay-buffer
for the requirements of such an ACTION function (and the list of standard functions, the code for which you can examine), but it will be responsible for displaying the buffer in whichever manner you so wish (and can certainly balance the windows afterwards).