ZoomWin.txt Zoom into/out-of a window Oct 30, 2015
Authors: Charles E. Campbell zoomwin
Ron Aaron
Copyright: (c) 2004-2014 by Charles E. Campbell zoomwin-copyright
The VIM LICENSE applies to ZoomWin.vim and ZoomWin.txt
(see copyright) except use "ZoomWin" instead of "Vim"
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
1. Usage zoomwin-usage
:call ZoomWin()
:ZoomWin
<c-w>o
Either of the two commands or the normal mode <c-w>o will toggle between
* selecting the current window for display as the only window or
* restoring the original multiple-window view.
==============================================================================
2. Setup zoomwin-setup
ZoomWin comes as a vimball; to install it, simply
Your .vimrc needs to have, at least:
(see 'nocp', :filetype, and :filetype-plugin-on for an explanation of
these commands)
==============================================================================
3. Options zoomwin-options
g:ZoomWin_funcref : this variable is used as a function reference
(Funcref) or as a List of function references.
It is called with a single argument:
What this does is permits ZoomWin users to have a
function called whenever ZoomWin changes state.
As an example, consider having the status line
indicate whether one is ZoomWin'd in or not:
The function, ZWStatline(), is called by ZoomWin()
every time it changes state.
g:zoomwin_localoptlist specify a set of windows options to be
saved and restored during zoom-in and zoom-out.
It may be empty.
Default:
g:zoomwin_preserve_taglist open and close a taglist window on
zooms
g:zoomwin_preserve_winmanager open and close winmanager a window on
zooms
==============================================================================
4. History zoomwin-history
v25 Jul 30, 2012 : (Paul, google01239) ZoomWin wasn't saving the
local value of 'diff'. It has now been included
in the s:localoptlist (options which are local).
* (Adam George) when clipboard=unnamed, ZoomWin
was overwriting the @* register. Fixed.
Oct 16, 2012 * (Marcin Szamotulski) reported that vim -o x y,
then zooming in and zooming back out resulted
in :swapname showing "No swap file". Fixed.
Oct 31, 2012 * (Adam George) reported that E13 errors occurred
* when one zoomed in, zoomed out, and then
* attempted to write. Fixed (due to [Scratch]
* file renaming)
Jan 14, 2013 * (Jorge Rodrigues) reported on errors in
RestoreUserSettings() associated with
saving and restoring the 'scrolloff' setting.
ZoomWin now protects against that by testing
if the current vim supports xterm-clipboard.
Mar 13, 2013 * (Ingo Karkat) provided patches for three
problems:
1) setting some options (like 'keymap') has
side effects; only restore an option if its
changed
2) :windo has side effect of changing the height
of every visited window from 0 to 1
3) matches are saved and restored (see
getmatches() and setmatches())
* buffers with bh=wipe were being wiped out during
zoom in and out. Fixed (cec)
Jul 15, 2013 * (Ingo Karkat) ZoomWin now works with i_CTRL-O,
removes an E481 when a count is used with
ZoomWin, and removed a superfluous <script>
modifier to the mapping.
Nov 09, 2013 * (Saad Malik) reported that ZoomWin+MiniBufExpl
caused the latter's window to expand after a
zoom-in/out. techlivezheng provided a fix
to have s:localoptlist include 'wfh' and
'wfw'.
Feb 19, 2014 * (Daniel Hahler) ZoomWin needs to save and
restore 'shm', setting it to shm+=A to
avoid "ATTENTION" messages when an existing
swap file is involved.
Mar 09, 2014 * (Adam George) reported that the @* register
problem was still present with MacOS (see
Rodriguez, above). Wrong clipboard test
was used; fixed.
v24 Jan 29, 2009 : g:ZoomWin_funcref supported
May 22, 2009 * supports the saving and restoring of window
variables across zooms
Oct 11, 2009 * The state wasn't being passed along to
g:ZoomWin_funcref as intended. Fixed.
Jul 09, 2010 * Put an exists() test into s:RestoreWinVars()
Jan 18, 2011 * (reported by talek) bypass winfixheight option
Apr 06, 2011 * Saves and restores local options for every window
v23 Apr 24, 2008 : when 'scrollbind' was activated: when ZoomWin
attempted to restore multiple-windows, the cursor
position was incorrect. Fixed.
Jan 02, 2009 * included some more things in the session file
* broke ZoomWin into an plugin + autoload pair
* (Ingo Karkat) contributed a patch to retain the
the search pattern before zooming
* (Ingo Karkat) contributed a patch to detect the
vim 7.2 name for the command line window
* too many files (more than the screen rows)
caused restoration problems.
v22 Apr 10, 2006 : "only" was occasionally issuing an "Already one
window" message, which is now prevented
* SavePosn() issued error message when handling an
empty buffer
* saves yank registers and restores them on each
zoom/unzoom
v21 Oct 12, 2004 : v14 fixed a bug when wmw and/or wmv equal to 0;
v21 will invoke the patch only if the version <= 603.
For vim version 6.3 users, this fix allows more files
to be handled by ZoomWin.
May 10, 2005 * When :version shows -mksession, and the vim version
is at least 6.3, ZoomWin will now do a partial zoom
v20 Jul 26, 2004 : bugfix - ZoomWin didn't always retain the
position in the former zoomed-in window after
the window layout was restored. It was restoring
the position when the zoom-in occurred.
v19 May 26, 2004 : bugfix - winmanager has events firing that,
amongst other things, reset the bufhidden
option to delete for some windows while
ZoomWin worked. ZoomWin now works
successfully with winmanager.
v18 May 20, 2004 : bugfix - didn't adversely affect anything, but
ZoomWin was deleting its session file twice.
* bugfix -- a multi-source file + minibufexplorer
+ Taglist interaction bug -- minibufexplorer's
autocmd events were firing, generating a new
window while ZoomWin was attempting to restore
the display. ZoomWin didn't have restoration
information for the new window and so reported
an error. Events are now temporarily disabled
while ZoomWin is restoring the layout.
v17 Mar 26, 2004 : ZoomWin command installed. Works nicely with
taglist: vim +Tlist +ZoomWin filename
v16 Dec 22, 2003 : handles bufhidden and nobl windows (TagList support).
* Now also works with quickfix window (:copen) but
still not with cmdline-window (q:)
v15 Dec 19, 2003 : SavePosn()/RestorePosn() needed to be preceded
by s: to prevent clashes
v14 Dec 18, 2003 : works around a restoration-bug with mksession
when either wmw or wmh settings are zero
* Bwipes internal temporary buffers
* Known bugs: will not work with command-line
* Editing window (cmdline-window) nor the
quickfix window (copen).
v13 Dec 18, 2003 : Uses eventignore to prevent events/autocmds from
firing while changing the mksession results.
v12 Dec 12, 2003 : uses hidden and a minimalist mksession save
v11 Oct 14, 2003 : bug fix: apparently RestorePosn()'s variables,
which were b:, weren't always defined, so s:
ones are now used.
v10 Sep 22, 2003 : Bug fix: when a single window is showing, the user
moves the cursor, then <c-w>o used to restore
screen, the current cursor position wasn't retained
Restores v:this_session.
Bug fix: change a window, use <c-w>o, then write.
Was saving file only to temporary file instead of
actual file, but when the actual file was brought back,
the changes were lost.
v9 Aug 15, 2003 : v8 managed to trash syntax highlighting on
reload, this one removes the eventignore
handling. Will need more pondering...
v8 Aug 14, 2003 : now handles not-modified but not filereadable
buffers, nowrite buffers uses eventignore to
bypass autocmd firing
v7 May 23, 2003 : bugfix - GotoWinNum() didn't always get the
cursor into the correct window
v6 Mar 25, 2003 : more cleanup included
v5 Mar 14, 2003 : includes support for handling scratch buffers,
no-name buffer windows, and modified-buffer
windows. All windows' contents will be saved to
temporary buffers
v4 Dec 12, 2002 : Zak Beck contributed code to clean up temporary
session files if one leaves vim while zoomed-in
v3 Dec 11, 2002 : plugin-ized
v2 Nov 08, 2002 : A guaranteed-to-be-unique to this
session file is used for session information.
Modified but not yet saved files are made hidden
during zoom in.
v1 the epoch : Ron Aaron's original
vim:tw=78:ts=8:ft=help