As Raimondi alluded to, your .vimrc has an ambiguous mapping for <C-w>
.
What I find more useful is to just completely remap Ctrl-w
to get the "change window" behavior I want:
imap <C-w> <esc><C-w>
Now, that allows me to still use <C-w><C-w>
to go to the next window as your mapping did, but it allow allows me to use all of the window movements (see :help window-moving
in Vim). To me, that's way more powerful, even though I lose the default <C-w>
behavior.
Back to your delay, and ambiguous mapping. You have one defined in your .vimrc, and one mapping built-in to Vim, so you have:
imap <C-w> [built-in behavior: delete previous word]
(not real syntax, just for illustration)
imap <C-w><C-w> <esc><C-w><C-w>
While Vi did not allow such mappings at all, Vim can deal with ambiguous mappings; The description in :help map-ambiguous
in Vim explains your situation well:
map-ambiguous
When two mappings start with the same sequence of characters, they are
ambiguous. Example:
:imap aa foo
:imap aaa bar
When Vim has read "aa", it will need to get another character to be able to
decide if "aa" or "aaa" should be mapped. This means that after typing > "aa"
that mapping won't get expanded yet, Vim is waiting for another character.
If you type a space, then "foo" will get inserted, plus the space. If you
type "a", then "bar" will get inserted.
{Vi does not allow ambiguous mappings}
If you want to keep the <C-w>
behavior available, your best bet is to probably map it to Ctrl-Backspace. It's not intuitive to do so, but per https://vim.fandom.com/wiki/Map_Ctrl-Backspace_to_delete_previous_word it is possible:
Mapping Ctrl-Backspace does not work in terminal Vim. Following is a
workaround.
noremap! <C-BS> <C-w>
noremap! <C-h> <C-w>