tags:

views:

1306

answers:

1

If I have a Vim window open with 2 splits in it (3 total buffers visible) and I've adjusted the viewport of each split, then I close one buffer, the other two buffer's viewport's are automatically resized.

Is there a way to maintain or at least better scale the split when I close a buffer?

1) Vim window with three splits, custom size:
  +---+-------+---+
  |   |       |   |
  | 1 |   2   | 3 |
  |   |       |   |
  +---+-------+---+
2) Close buffer 3, splits are resized to "best fit":
  +-------+-------+
  |       |       |
  |   1   |   2   |
  |       |       |
  +-------+-------+
3) I want it to stay like this, resize only adjacent buffer:
  +---+-----------+
  |   |           |
  | 1 |     2     |
  |   |           |
  +---+-----------+
+10  A: 
set noea
" i.e.
set equalalways

See equalalways in the Vim documentation.

strager
Thanks a bunch! I did search the documentation but I guess I didn't search hard enough :-/
sirlancelot
vim's documentation is fantastic as long as you know what you're looking for. Figuring out what you should be looking for is a bit trickier.
rampion