I always have this problem. When a windows seems too small to view code, i will type :only the maximum this window and hide other windows. But when the editing is finished i quit want to restore the previous status of windows. Exactly the same before i maximum one window. It there any plugin to do this job? Or it’s build-in in vim?
EDIT: I found a plugin called ZoomWin can actually do this job. But 0 can’t been map to :ZoomWin in my vim. Still don’t know why. The help file says i can use 0 to call Zoomvim just after i installing this plugin.
You could probably write a script using
mkviewandloadviewif you wanted to keep this all in one tab, however, this is the exact thing that vim’s tabs were made for. I suggest using the following mapping to map\0to open the current buffer in a new tab. To close the tab just do:qas you would normally do and you’ll go back to your previous tab which contains the window layout you want.Note that this mapping uses
<leader>so if you’ve changed your mapleader then the sequence will not be\0.