1

I have been a QtCreator user for long now. Just switching to JS & Go.

With FZF, I have created these mappings

nnoremap <C-k>  :Files! <CR>     
nnoremap <C-k>. :BTags! <CR> 

So <C-k> is prefix for all my commands. I find this to be working, but I find my first key mapping is now delayed. I am assuming it's because vim has to wait for next key.

Wondering if there is a way to configure this delay.

2
  • 2
    The first mapping is CTRL+K, so Vim must wait to distinguish it from the second one.
    – Matt
    Aug 24 '20 at 16:49
  • 1
    Welcome to Vi and Vim!
    – filbranden
    Aug 24 '20 at 22:40
2

You can set 'timeoutlen' to control the length of this timeout. It defaults to 1000 ms, or one second.

This assumes that 'timeout' is set, which is the default. If it isn't, then Vim will keep waiting for more keys when you have a prefix of a mapping pending.

My advice is to avoid the issue altogether, don't create mappings that are a prefix to other mappings. Instead, make sure they differ on the last character, to ensure each mapping will always be unambiguous and you won't depend on a timeout to trigger them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.