3

I'd like to map CTRL-W to something else, but I'd also like to retain the functionality of CTRL-W, for resizing windows, moving between splits, etc. So I'd like to move it to something like CTRL-Q.

However, my naive attempt of the following doesn't work quite right:

nnoremap <C-Q> <C-W>
nnoremap <C-W> iexamplemapping<esc>

CTRL-Q seems to work the same as CTRL-W did previously. But CTRL-W seems to wait for about a second before executing the new mapping. Is there any way to have it execute it immediately? Would I have to remap every combination of <C-W><C-W>, <C-W>_, etc. ?

1 Answer 1

3

When I configure just those two mappings I do not see any timeout delay after typing C-w. You might want to check if something else (a plugin?) has defined any additional mappings that start with C-w:

:verbose map <C-W>

You will encounter the timeout (see :help 'ttimeout') if you have any other (normal mode) mappings that also start with C-w.
E.g. If you also have the mapping nnoremap <C-w>f ifrob<Esc> active, you will see a timeout delay after typing a C-w (until you type some other character so that Vim can tell whether you wanted the C-w mapping, or the C-w f mapping).

1
  • Yeah, I had a custom <C-w>[char] mapping that I forgot about :/ Cheers. Jan 23, 2013 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .