Search code examples
visual-studio-codevscodevim

VSCode Vim Settings not working for remaps with "


I have this in my settings.json for preventing vim from replacing my clipboard when I delete something:

  "vim.visualModeKeyBindingsNonRecursive": [
    {
      "before": ["<leader>", "d"],
      "after": ["\"_d"]
    },
    {
      "before": ["<leader>", "p"],
      "after": ["\"_dP"]
    }
  ],

I have other settings which work just not this one. I suspect its the \" in the after setting, not sure if that's really the problem. Help?


Solution

  • This is what worked for me.

    {
      "vim.visualModeKeyBindingsNonRecursive": [
        {
          "before": ["<leader>", "d"],
          "after": ["\"", "_", "d"]
        },
        {
          "before": ["<leader>", "p"],
          "after": ["\"", "_", "d", "P"]
        }
      ]
    }