VSCodeVim / VSCodeVim/Vim

Remapping of `ys` as in the vim.surround plugin doesn't work.

Open
#9,045 4 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

Describe the bug
When trying to use the following setting to remap * to ys which is the trigger for vim.surround plugin, it doesn't work as expected:

    "vim.normalModeKeyBindingsNonRecursive": [
       {
            "before": [
                "*"
            ], 
            "after": [
                "y",
                "s"
            ]
        },
]

To Reproduce
Use the aforementioned remapping. and type * in normal mode, then a and a quotation mark like aw" (i.e. type *aw" in normal mode).

Expected behavior
The word under the cursor be surrounded in ", which is the behaviour of typing ysaw" in normal mode.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.27.3
  • VSCode version: 1.89.1
  • OS: Windows 11 23H2

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 normal-mode remapping with the shown configuration and the *aw" sequence, then trace how keybindings are passed to the vim.surround behavior. Done means the remapped sequence surrounds the word in quotes just like ysaw", while preserving the existing direct behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.