VSCodeVim / Vim

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

How to remap the percentage symbol "%" such that it can jump between paired tags? #8211

Open gaoqiangks opened 1 year ago

gaoqiangks commented 1 year ago

The percentage symbol jumps between paired symbols. I want to remap such that it can jumps between paired tags. For example, I use vscode to write latex code. The latex extension provides a command: "latex-workshop.navigate-envpair" so that I can jump between paired tags. Then how to remap "%" such that "%" behaves both correctly for symbols like "( )" and paired tags ?

cirosantilli commented 3 months ago

And "Emmet: Go to Matching Pair" https://stackoverflow.com/questions/42996522/jump-to-closing-tag-in-vs-code

The procedure should be the same as for any other mapping, e.g. along:

 "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["<leader>", "%"],
      "commands": [
        {
          "command": "editor.emmet.action.matchTag"
        }
      ]
    }
]

but with the correct command?

The only thing I don't know how to do is to set a mapping only for certain filetypes. https://stackoverflow.com/questions/34247939/how-to-set-per-filetype-tab-size-in-vs-code almost gets there but we'd need to merge lists by filetype in this case.