I'm using <c-w><space>
to open current terminal buffer in a new tab:
tnoremap <c-w><space> <c-w>:tab split<cr>
This map cause <c-w><c-w>
trigger mapping delay in terminal mode, why would that happen? Are there any relation between <space>
(0x20) and <c-w>
(0x17) ?
The <c-w><space>
works fine, it doesn't trigger mapping delay.
I have created an rc file with this single command and tested it with vim -Nu rc
, the result didn't change.
FWIW, I also use this map in normal mode:
nnoremap <c-w><space> :tab split<cr>
It works fine, it doesn't affect <c-w><c-w>
int normal mode.
I'm using vim8.1-2300, ubuntu 18.04.4, zsh 5.4.2
C-w
is not written in the typeahead immediately (not printed in the'showcmd'
area). Maybe Vim waits for&timeoutlen
ms to determine whether the key must be remapped or executed with its default meaning (start a C-W command, as set by'termwinkey'
). I guess that the key assigned to'termwinkey'
is handled differently in Terminal-Job mode compared toC-w
in normal mode. You could somewhat get around the timeout by installing this mapping:tno <c-w><c-w> <c-w><c-w>
.2000
timeoutlen, it woks like you described, the workaround works too! I think you can post that as an answer.