0

When I start gvimdiff, the two windows occupy 50% of the window width. Exactly what I want.

However, when I then maximize the gvimdiff window via the window manager, the width of the left window stays as is and all the extra width is allocated to the right window. Is there a way to keep the window width 50/50 when maximizing (or more generally, for any horizontal resize operation)?

Jens
  • 69,818
  • 15
  • 125
  • 179

1 Answers1

1

I don't think there's an option for this. You can get close with an autocmd for the VimResized event:

autocmd VimResized * normal ^w=

Where ^w is produced by Ctrl-v+w. Or without control characters:

 autocmd VimResized * exec "normal \<C-w>="
Thor
  • 45,082
  • 11
  • 119
  • 130
  • Sweet! Interestingly, the help for CTRL-W = says *make all windows the same height*; adjusting the width to 50/50 appears to be a side effect. – Jens Feb 27 '13 at 10:51
  • Well it says *make all windows the same height & width*, but indeed this is not a perfect solution, although it should be fine for the split vimdiff situation. – Thor Feb 27 '13 at 10:57
  • The vim help was updated somewhere between 7.0 and 7.3 to also mention width. – Jens Feb 27 '13 at 12:15