Vscode-neovim: Investigate if it's possible to make jj work

Created on 5 Dec 2019  路  5Comments  路  Source: asvetliakov/vscode-neovim

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

enhancement

Most helpful comment

@dbalatero , @satvikpendem Thank you for suggestions

both jj, jk are supported

All 5 comments

@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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erlais picture erlais  路  3Comments

pieterdd picture pieterdd  路  4Comments

trkoch picture trkoch  路  3Comments

zeljkofilipin picture zeljkofilipin  路  3Comments

DrakeXiang picture DrakeXiang  路  5Comments