sponsor Vim development Vim logo Vim Book Ad

windows_remember_size.vim : Expands the current window when focused to the size you last gave it.

 script karma  Rating 5/2, Downloaded by 74    Comments, bugs, improvements  Vim wiki

created by
joey twiddle
 
script type
utility
 
description
== New version: tries to automatically keep up without whatever layout changes
you make, by storing an unfocused and focused size for each window. ==

Explanation: Whenever you leave a window, it remembers what size it was, and
whenever you enter a window, it remembers what size it was before entering.
Thus it records "focused" and "unfocused" sizes for each window, and it will
try to grow/shrink windows on entering/leaving, to match the recorded value.

Note: This system is not perfect, specifically when adding a new window
(changing the layout) it makes no attempt to redistribute the space, so
other windows will act greedily until they are adjusted.

Solution: The best approach appears to be, as soon as your layout breaks in
some way, fix it immediately with 20<C-W>+ or whatever, to minimize the
damage (before the new broken values get recorded).  This is a small overhead
for the user, in exchange for the benefit gained with a fixed number of windows.

If you want to start afresh you can :call ForgetWindowSizes() and then Ctrl-=.
 
install details
Drop in plugin/ folder
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
windows_remember_size.vim 2.0 2012-10-24 6.0 joey twiddle Another alternative approach.
windows_remember_size.vim 1.0 2012-10-24 6.0 joey twiddle Initial upload
ip used for rating: 54.235.20.17

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo