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. – lawlist Feb 22 '16 at 17:26split-height-threshold
andsplit-width-threshold
-- https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Choice.html – lawlist Feb 22 '16 at 17:49display-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). – phils May 29 '16 at 11:52shackle
package, which allows you to specify rules about how window popups work. I can't guarantee it will give you complete control. – Att Righ Mar 09 '17 at 19:44winner-mode
helps with with this problem enormously as it gives you a window configuration history and allows changes to be easily undone. – stevoooo Apr 04 '17 at 14:26