VSCodeVim / Vim

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

Remapping "<leader> d" to "\"_" (black hole register) not working #9247

Open raulpenate opened 1 week ago

raulpenate commented 1 week ago

Describe the bug I am trying to remap <leader> d to use the black hole register ("_) so that Vimium discards the deleted or changed text without saving it in a register. However, this remapping is not working as expected. Instead of behaving like "_, the command behaves like ci{, which means the text gets deleted but not properly handled by the black hole register.

To Reproduce

  1. Add the following configuration to your settings.json:
    "vim.normalModeKeyBindings": [
      {
        "before": ["<leader>", "d"],
        "after": ["\"_"]
      }
    ],
  2. Go to any source code in VSCode.
  3. Copy some text from the file or another source.
  4. Press <leader> d followed by ci{ to delete content inside curly braces.
  5. Paste using ctrl+v or "+p.

Expected behavior

Screenshots Log example:

image

Video example:

https://github.com/user-attachments/assets/3dfc2be4-be01-430e-9c68-b5ad651912ac

Environment (please complete the following information):

HenryTSZ commented 5 days ago

use this

    {
      "before": ["<leader>", "d"],
      "after": ["\"", "_"]
    },