VSCodeVim / Vim

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

Allow specifying multi char strings for vim.*KeyBinding* options #9010

Open bradphelan opened 5 months ago

bradphelan commented 5 months ago

When I want to create key maps with many sequential characters then there is way too much boiler plate. For example in vim script

nnremap ,nf di//clang-format off<cr>//clang-format on<esc>P

maps to

{
      "before": ["<leader>", "n", "f"],
      "after": [
        "d",
        "i",
        "/",
        "/",
        " ",
        "c",
        "l",
        "a",
        "n",
        "g",
        "-",
        "f",
        "o",
        "r",
        "m",
        "a",
        "t",
        " ",
        "o",
        "f",
        "f",
        "\n",
        "/",
        "/",
        " ",
        "c",
        "l",
        "a",
        "n",
        "g",
        "-",
        "f",
        "o",
        "r",
        "m",
        "a",
        "t",
        " ",
        "o",
        "n",
        "<Esc>",
        "P"
      ]
    }

which is really unnecessary. It should be possible to do

{
  "before": "<leader>nf",
  "after": "di//clang-format off<cr>//clang-format on<esc>P"
}