I often have split windows in a frame where one is much smaller than the other (usually done through C-u C-u C-x ^). This is so I can see some snippet of code as reference while doing something else.
The problem is: when I use C-x 4 b to switch to some other buffer (or C-x 4 f to open a new file in the lower window), the lower window is resized to its original half-the-frame height size. Is there a way to stop that from happening and keep my smaller window size?
If you evaluate
(setq even-window-heights nil)before running C-x 4 f (or a similar command), Emacs won’t try to balance the heights of your windows. Here’s the documentation foreven-window-heights:I recommend writing a small elisp function that sets this variable to nil and then calls
switch-to-buffer-other-windoworfind-file-other-window, since it’s probably something that you’ll want to do frequently.