The idea is to not listen in insert mode, but rather bind j to some handler. Then run timer - if same command was pressed within timer's timeout - call escape, if not - insert j (alternatively insert j immediately, then remove if needed).
This won't work for jk but can be good compromise
@asvetliakov This is the same technique I use in my Vim-everywhere plugin for Mac.
It's unfortunate you cannot watch all the keys at once though. If you _can_ watch all the keys then you can deal with it in the same manner I did:
https://github.com/dbalatero/VimMode.spoon/blob/vim-mode-v2/lib/key_sequence.lua#L96-L140
Another 3rd-party possibility for people is to figure out how use something like Karabiner to bind a sequence like jk to fire something out of keyboard range like F20, then bind F20 to Vim mode:
https://pqrs.org/osx/karabiner/json.html#typical-complex_modifications-examples-change-right-shift-x2-to-mission-control
The VSCode Vim extension does insert a character and then removes it if a chord is pressed. Might be something to look into.
@dbalatero , @satvikpendem Thank you for suggestions
both jj, jk are supported
fresh!
Is it possible to configure the keys directly? I'd like to use fd instead, looks like you use the variable vscode-neovim.compositeEscape1/2, might be good to make them user configurable.
Edit: just reread the README, looks like it is configurable. Thanks!
Most helpful comment
@dbalatero , @satvikpendem Thank you for suggestions
both
jj,jkare supported