I can already map a key combination in insert mode:
:inoremap abc <do stuff>
However, this has a few drawbacks:
When typing a partial version of the sequence, such as
ab
, the characters aren't actually displayed for a short amount of time, since it's "waiting" to see whether you're going to type the full command. This is undesirable; I want to map a chain of letters without pausing if a partial substring of the chain is entered.If I type
ab
, then pause (and wait until the characters actually appear as mentioned in the above point), then type thec
, the command is not executed. I want the command to be executed no matter how long I wait.
I would use an iab
, but that doesn't work because:
- It requires entering a space after the string
- I can't execute arbitrary commands with it, only insert a string of text.
Is there any way to execute a command or keystrokes if a certain string is entered in insert mode, without using a map (which will annoyingly pause every time I type an a
and not work if I wait too long)?
:cnoremap abc <do stuff>
...ab<any key>
.