如何将VSCode中Vim扩展的关键绑定从插入模式更改为正常模式?

5
  1. 如何改变在插入模式和普通模式之间切换的快捷方式?
  2. 我在哪里可以找到所有vim扩展快捷方式及其命令的列表?我在键盘快捷方式中搜索过,但只能按键绑定进行搜索,这使事情变得复杂。

谢谢!

1个回答

4
  1. I settled on mapping ^ + [ to the command extension.vim_escape. Additional detail for the community:
    • Open keybindings.json
      • ⇧ + ⌘ + p or ctrl + shift + p by default
      • Enter Preferences: Open Keyboard Shortcuts
      • Select the file icon in the top-right corner of the pane:
        file-icon
    • Add the following JSON object to the list:
      {
      "key": "ctrl+[",
      "command": "extension.vim_escape",
      "when": "editorTextFocus && vim.active && !inDebugRepl"
      }
      
    • Notes:
      • Setting "vim.useCtrlKeys": true in settings.json might also be required
      • I assume that a different escape sequence could also be used
      • I'm using vscodevim.vim version v1.17.2 on macOS
  2. In the keyboard shortcuts UI (not the JSON file), searching for extension.vim_ showed a list of Vim "Commands" that can be sent to the Vim emulator according to their keybindings
    • For example, after performing the above, searching for extension.vim_escape provides the following:
      vim-commands

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接