Reset the layout of vim after terminal resize

Viewed 1099

If I have a vim / nvim session running and I resize the terminal then it messes up the layout and vim continues to act as if it was x columns wide.

Is there a command I can run for vim to refresh the layout and rerender with the updated column width.

2 Answers

You can press Ctrl-W= to recalculate the splits based on the new terminal size.

See :help ctrl-w:

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.

It looks like you may have messed up terminal screen size. Try

CTRL + (+)

to Increase screen size and

CTRL-SHFT-(-)

to reduce screen size

Related