On May 10, 9:12 am, Chris Jones <[email protected]> wrote: > 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!
Again Thanks. I was wondering if the problem was because my plugin setup etc. Unfortunately the response is not what I expected :) I was hopping to easily remove :only mapping. I try the longer timeoutlen and see if I can work with that. I am using the Zoomwin plugin, I just disabled the mapping for :only but that helps a little too. I am still hoping for better solution, because the behavior is somewhat strange to me. Timeout is reached but still the vim internal commands gets called. ( not my maped command) Maybe this is expected behavior, but just doesn't gets to me. Anyway I observed similar thing with window movements and splits creation. After you start by <C-W> you have undefined time (not the timeoutlen) to perform hjkl or sv what I mean by that is 'hjkl' stands for movement and 'sv' are splits. I am not sure if that is a bug or this should work like that. -- 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
