I am trying to use KBC Poker 3 keyboard which combines `,~ and <Esc> as one key with Vim and wondering if it is possible to use the quick press of the escape key as char '`', and long press of escape key (longer than 500ms) as escape key.

Is it possible?

  • 1
    I don't think it's possible, but you can try to map two press as another one, that will simulate the workflow you want.
    – nobe4
    Jun 17 '16 at 17:55

As far as I know there is no built-in support for mappings that change based on the time you hold the key.

But as the problematic key is Esc, you have some good alternatives:

  1. Use Ctrl+[, which works by default (as explained in :help key-codes):

    <Esc>       escape          CTRL-[   27 *escape* *<Esc>*
  2. As Esc is a heavily used key in Vim, many people use mappings for it, such as jj, jk, or CapsLock:

If you choose to remap the CapsLock (as I did myself), you may find the capslock plugin useful.

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.