50

When I open gvim -S (with a session) my split screens' widths are screwed up and I have to manually adjust them.

Is there a shortcut to make all split screens the same width ?

Thanks

Running Turtle
  • 12,360
  • 20
  • 55
  • 73

2 Answers2

93

This should normally work:

    C-w=
see window-resize

There are exceptions with windows that maintain a minimum/maximum width. This is frequently the case with 'sidebar' style plugins (taglist, nerdtree); In which case it is probably only what you wanted when they don't resize.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • Is there a way to do this for the width only? – Mr Mikkél Jan 20 '22 at 17:28
  • @MrMikkél not that I know of, but maybe `:se ea ead=hor | vert split | close` approximates? Otherwise you would use `:vert resize` with a calculated argument , e.g. from a script funtion – sehe Jan 20 '22 at 21:00
10

From the vim help pages:

CTRL-W =    Make all windows (almost) equally high and wide, but use
            'winheight' and 'winwidth' for the current window.
            Windows with 'winfixheight' set keep their height and windows
            with 'winfixwidth' set keep their width.
Michael Foukarakis
  • 39,737
  • 6
  • 87
  • 123
  • Thank you, this helped me understand that I needed to unset `winfixheight` in order to be able to resize Eclim's project settings window with `C-w =`. – henrebotha Dec 06 '17 at 10:21