VSCodeVim / VSCodeVim/Vim

Check if a chord is active

Open
#9,005 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how VS Code evaluates keybindings from keybindings.json and how VSCodeVim handles vim.normalModeKeyBindings and chords. Compare the requested when condition with the existing keybinding behavior, including editor.action.showHover; done means a currently active chord can be detected without being shadowed by another binding.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.