On Wed, May 09, 2012 at 06:32:50PM EDT, Krzysztof wrote:
> 
> I will try to clarify.
> 
> First the problem:

> noremap <C-W>O :echo "You dont want this"<CR> etc. this is to block
> :only

> What I mean by that is keyboards shortcuts for :only which is
> <C-W><C-O>,<C-W>o

> The problem is, this don't work as I expected.

> When I am in normal mode, I work with many splits(horizontal and
> vertical) .

> Sometimes when I try to switch between the splits instead of

> <C-W>k
> or
> <C-W>l
> i type
> <C-W>o

> Then all my splits are gone, and I have to setup them again.

Now I understand.. I must have missed an episode..

I just gave it a try and it _looks_ as if when you remap <C-W>o, Vim
waits for the duration of ‘timeoutlen’ after you type <C-W>. 

If you type the ‘o’ before the timer expires, your custom mapping is
executed.

If you don't, Vim falls back to the builtin: the ‘:only’ behavior.

I just tested this after setting ‘timeoutlen=5000’ and as long as
I waited less than five seconds between the key strokes, the message was
echoed to the terminal.

I proceeded to test and slowly counted to one... two.. three.. four..
five.. and sure enough all my windows but one were gone..

Note that I also have ‘ttimeoutlen’ set (rather than the default of -1).

The help is not very clear: it states that ‘The timeout only happens
when the 'timeout' and 'ttimeout' options tell so.’ I think that this
needs to be clarified.

Anyway, you could try setting timeoutlen to a few seconds and see if it
helps.

Another (non-exclusive) possibility is to install the Zoomwin plugin so
that <C-W>o becomes a toggle that closes all windows and later brings
them back to life. 

But mind you.. from what I'm.. guessing, you would still need to set
timeoutlen & (possibly) ttimeoutlen to adequate values.

HTH

CJ

-- 
Oh My God!!! Larry is back!

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to