Bram Moolenaar schrieb:
>
> Yakov Lerner wrote:
>
>> I'd lile to hear people feedback about "timeout per-mapping" wish, like:
>>
>> :noremap <timeout=200>XYZ ......
>>
>> I have certain mappings for which wish to define
>> smaller timeout that my usual keyboard timeout.
>> Does anybody have feedback ?
Would be helpful if you posted the mappings ...
> This would be very difficult to implement. A simpler thing would be to
> define a timeout for mappings starting with a certain character.
For example, users of
:imap jj <Esc>
may find this useful:
imap j <sid>Stm<sid>_
imap <sid>_j <sid>Ntm<Esc>
ino <script> <sid>_ <sid>Ntmj
" set Short 'timeoutlen':
ino <silent> <sid>Stm <c-r>=<sid>set_tm(300)<cr>
" set Normal 'timeoutlen':
ino <silent> <sid>Ntm <c-r>=<sid>set_tm(3000)<cr>
func! <sid>set_tm(tm)
let &timeoutlen = a:tm
return ""
endfunc
Now, "jj" has to be typed within 300 ms, else "jj" will be inserted
literally. Works also for Vim6.
> But I doubt that's useful.
--
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---