VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.73k stars 1.31k forks source link

Check if a chord is active #9005

Open musjj opened 4 months ago

musjj commented 4 months ago

Is your feature request related to a problem? Please describe. When creating mappings in keybindings.json, it's possible to create a collision with a Vim chord.

So for example, you have a shift+k in your keybindings.json and [ "ctrl+w", "K" ] (or [ "ctrl+w", "shift+k" ], it doesn't matter) in your vim.normalModeKeyBindings. shift+k will take priority here, making [ "ctrl+w", "K" ] impossible to trigger.

Describe the solution you'd like A way to detect if there's a currently active chord. The condition can then be put into when, to ensure that it doesn't shadow the chord.

Describe alternatives you've considered You can map the keybind in your vim.normalModeKeyBindings, but some commands don't behave properly as a Vim binding for some reason. For example, editor.action.showHover (gh) doesn't behave properly when mapped as a Vim binding: https://github.com/VSCodeVim/Vim/issues/3740#issuecomment-1902688140