sponsor Vim development Vim logo Vim Book Ad

[obsolete]ToggleOnly.vim : Simple enhancement of ^W ^O

 script karma  Rating 1/3, Downloaded by 1487  Comments, bugs, improvements  Vim wiki

created by
Eric Arnold
 
script type
utility
 
description
[I expanded all the tabs to spaces, and it's still all messed up :( ]

"
"                                ToggleOnly.vim:                          
"
"                A reworking of the ^W^O "Only window" idea of maximizing
"                the current window, but also maximize the new one as you
"                switch windows.  (Actually, it's evolved to have nothing
"                in common with   :only   anymore, but I liked the ^W^O,
"                and <C-W><C-_> had no catchy name.)
"
"
" Version:       1.1
"
" Author:        Eric Arnold ( eric_p_arnold in_the_vicinity_of yahoo.com )
"
" Description:   Remaps ^W^O   ^W^W   ^W^K   and a few related keys to
"                fully expand the current window without closing any.
"                Emphasis is on simplicity, key ergonomics and usability.
"                I wanted something I would actually use all the time.
"                Your [personal preference] milage may vary.  I used the
"                ^W keys to move through windows before, so tried to
"                integrate smoothly with them.  Small bumps in the
"                original are smoothed out, i.e. ^W^J and ^W^K wrap
"                around.
"
" <C-W><C-O>     Toggle the Only Window Mode ON/OFF.  
"                <C-W><C-O>   <C-W><C-_>   <C-W>o   are synonymous.
"                <C-W>O toggles auto-expand.
"                The rest of the keys are only mapped when Only Window Mode ON.
"
" Mouse          Window will resize when the mouse cursor enters it or
"                its [clicked]statusbar.  See config section.
"
"
" <C-W><C-K>     Up one window, resize to full, wrap around at top.
"
" <C-W><C-W>     Next/Down one window, ditto.  
"                <C-W><C-J> is synonymous.
"
" <C-W>w or j    Next window, and resize to 1/2 total &lines, giving the
"                previous window the other half, wrap around at bottom.
"                These provide a way to move around with a little more
"                visibility without leaving Only Window Mode.
"
" <C-W>k         Previous window, ditto.
"
"
"        Note:  if  "g:ToggleOnlyAutoExpand"  is set (true by default),
"        windows will be expanded when *anything* moves the cursor into
"        them.
"
"
"
"    Configuration Notes:    
"
"        Whether you need to click on the statusbar depends on how you
"        have "&mousefocus" set.  You can tone down the aggressive
"        behavior of the auto-expand by turning "&mousefocus" off,
"        without disabliing auto-expand altogether.
"
"
"        "timeout" and "ttimeout" are turned off since it's extra
"        annoying when it times out to the default ^W^O, which closes all
"        other windows.  You may want to reset these if you have
"        mappings like   ,s  and   ,st    which depend on a timeout
"        for  ,s   to be accepted, or some other key, i.e.  ,s<ESC>  
"        works without timeouts.
"        "g:ToggleOnlyTimeouts"  is "exe"'d, so get your syntax
"        right.  If want timeouts, try something like this in your
"        ".vimrc":
"
"    let g:ToggleOnlyTimeouts = 'set timeout ttimeout timeoutlen=2000 ttimeoutlen=2000'
"
"        An autocommand is set for "BufEnter" to resize any window,
"        which allows you to mouse into a window and have it resize.
"        This is controled by:
"
"    let g:ToggleOnlyAutoExpand = 1
"
"        To save space when the windows are minimized, "&winminheight" is
"        set to zero.  This is changed with:
"
"    let g:ToggleOnlywinminheight = 0
"
"
"
"    Updated:        Wed Jun 08, 6/8/2005 5:14:07 PM
"          General overall refinement.
"     -    Now uses ^K and k, ^W and w, which is better than O and o.
"     -    All keys wrap around at top/bottom, not just ^W.
"     -    Added a BufEnter autocommand so mouse will trigger resize
"     -    Keymaps are more correct (nnoremap instead of map), and are
"          only mapped when ^W^O toggles them on.
"     -    Set &winminheight to 0 to save space around statusbars.
"     -    Added a few config options.  Keymap timeout issue addressed, and
"          config option added.
"     -    Added a two window auto expand option

 
install details
Put into plugin directory.
 

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
ToggleOnly.vim 1.1 2005-06-08 6.0 Eric Arnold " Updated: Wed Jun 08, 6/8/2005 5:14:07 PM
" General overall refinement.
" - Now uses ^K and k, ^W and w, which is better than O and o.
" - All keys wrap around at top/bottom, not just ^W.
" - Added a BufEnter autocommand so mouse will trigger resize
" - Keymaps are more correct (nnoremap instead of map), and are
" only mapped when ^W^O toggles them on.
" - Set &winminheight to 0 to save space around statusbars.
" - Added a few config options.  Keymap timeout issue addressed, and
" config option added.
" - Added a two window auto expand option
ip used for rating: 18.119.160.154

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