sponsor Vim development Vim logo Vim Book Ad

ZoomWin : Zoom in/out  of windows (toggle between one window and multi-window)

 script karma  Rating 148/785, Downloaded by 21396  Comments, bugs, improvements  Vim wiki

created by
Charles Campbell
 
script type
utility
 
description
Note: version 23 or later of ZoomWin requires vim 7.2 or later

Usage:

    Press <c-w>o : the current window zooms into a full screen
    Press <c-w>o again: the previous set of windows is restored

Features:

The idea is to make it easy to zoom into and out of a window.  ZoomWin supports normal windows, and it now also supports scratch-windows, no-name windows, and modified-buffer windows.

* ZoomWin is a 7.2 plugin (as of v23)

* Files are made hidden during zoom-in and restored upon zoom-out

* All windows' file contents will be restored during zoomouts.

* ZoomWin will clean up any temporary files it generates upon exit.

* Session files are guaranteed to be unique to each vim session, so multiple vims can use zoom-in/out without interfering with one another

A later version may be available at http://www.drchip.org/astronaut/vim/index.html#ZOOMWIN .

When zooming in, ZoomWin's window is full sized, with no loss of screen space to status lines for other windows, unlike vimscript#1280 (ToggleOnly), for those vims compiled with the +mksession feature.  For those vims without that feature, v21 ZoomWin now supports partial-zoom-in (leaves a status line behind for each window).

History:

Ron Aaron came up with the original ZoomWin and gave permission to have it posted.
 
install details
The latest version of ZoomWin uses vimball, so with vim 7.1 its particularly easy to install:
  vim ZoomWin.vba.gz
  :so %
  :q
With 7.0, you'll need to upgrade your vimball plugin first.
 

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
ZoomWin.vba.gz 24 2012-06-18 7.3 Charles Campbell new     : g:ZoomWin_funcref (holds name of function to be called whenever ZoomWin changes state); see :help g:ZoomWin_funcref
improved: supports saving and restoring of window variables across zooms
bugfix  : saves and restores local options for every window
ZoomWin.vba.gz 24 2012-06-18 7.3 Charles Campbell new     : g:ZoomWin_funcref (holds name of function to be called whenever ZoomWin changes state); see :help g:ZoomWin_funcref
improved: supports saving and restoring of window variables across zooms
bugfix  : saves and restores local options for every window
ZoomWin.vba.gz 23 2009-01-26 7.0 Charles Campbell ZoomWin has been split into a plugin + autoload portion for faster vim startup.
Bug fixes (scrollbind caused the restore to have an incorrect cursor position, retains the search pattern present before zooming, more files than screen rows problem)
ZoomWin.vba.gz 22 2007-12-19 7.0 Charles Campbell Uploading ZoomWin in vimball format (makes it easier to install)
ZoomWin.vim.gz 22 2006-04-10 6.0 Charles Campbell * The internally used "only" command was occasionally issuing an "Already one window" message, which is now prevented.
* SavePosn() issued an error message when ZoomWin was handling - fixed!
* Saves/restores yank registers for every zoom/unzoom.
ZoomWin.vim.gz 21 2005-05-10 6.0 Charles Campbell * For vim version 6.3 or later, but with -mksession, ZoomWin will now do partial zooms
* 6.3 or later vim users can now handle more windows
* Bugfix - sometimes when zooming in, the wrong positioning was restored.  Fixed!
ZoomWin.vim.bz2 19 2004-05-26 6.0 Charles Campbell bugfix - winmanager's events, such as one to reset bufhidden to delete, caused ZoomWin to occasionally restore empty windows.  ZoomWin now works successfully with winmanager.
ZoomWin.vim.bz2 18 2004-05-25 6.0 Charles Campbell bugfix : a Taglist+minibufexplorer+ZoomWin interaction sometimes caused minibufexplorer to create a new window while ZoomWin was busy restoring the windows.  ZoomWin then issued a complaint that it didn't know how to restore the new window.  ZoomWin now temporarily disables events while it is restoring windows.
ZoomWin.vim.gz 17 2004-04-02 6.0 Charles Campbell ZoomWin now has a command (:ZoomWin, of course!).  Works
nicely with taglist:    vim +Tlist +ZoomWin filename
This cmd starts the taglist window but maximizes the filename's window
ZoomWin.vim.gz v16 2003-12-22 6.0 Charles Campbell ZoomWin is both faster and half the size of its v13 and earlier versions.  V16 also allows quickfix windows and handles TagList windows (bh=delete, no buffer listing).
ip used for rating: 54.225.1.66

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.
   
Vim at Github