VSCodeVim / VSCodeVim/Vim

Remapping the "y" key to "<left>" still trigger the yank action

Open
#7,585 10 comments 3 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

Describe the bug
A clear and concise description of what the bug is.

In an attempt to support the workman layout, I remapped y to <left> to support familiar hotkeys for navigation.

The j, k and l seem to work, but I must press y two times to move left.

To Reproduce
Steps to reproduce the behavior:

  1. Set the following settings:
"vim.normalModeKeyBindings": [
    {
        "before": ["y"],
        "after": ["<left>"]
    }
]
  1. Open a text file
  2. Try navigating to the left using y
  3. Notice that the yank action is still triggered in the status bar, and you have to press y multiple times to move.

Expected behavior
A clear and concise description of what you expected to happen.

With the key mapping, pressing y a single time should move to the left.

Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.

https://www.youtube.com/watch?v=DMJzEtK6_Cc

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.22.2
  • VSCode version: 1.64.2
  • OS: Linux

Additional context
Add any other context about the problem here.

I have the keyboard.dispatch setting to keyCode.

I'm using the config from this repo: https://github.com/ajgrf/workman-vim-bindings/blob/master/vscode.json

I'm using the workman layout as my keyboard layout.

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 reproducing the issue with the shown vim.normalModeKeyBindings configuration, the workman layout, and keyboard.dispatch set to keyCode. Trace the key-remapping path for y and compare it with the working j, k, and l mappings; done means pressing y once moves left without triggering yank.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.