Many windows in vim can are opened in some predefined layouts (e.g. copen or :Gstatus). However, further layout changes will disrupt original widow height. I often end up with windows of height 1 or 2 making them almost unusable.

How can I set size to value it previously had with single command for any resized window? I should be able to do it for all windows and get original layout provided the same windows are visible.


You can :set minimal hard window limits with 'winminheight' and 'winminwidth'. Also, winrestcmd() returns a sequence of commands that restore the current window layout.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.