简体   繁体   中英

How do I remap the keybindings to change modes in vscode vim extension from insert to normal mode?

  1. How does one change the shortcut to switch between insert mode and normal mode?
  2. Where can I find a list of all vim extension shortcuts and their commands? I searched for them in keyboard shortcuts but you can only search by keybindings which complicates things.

Thanks!

  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:
        文件图标
    • 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 命令

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM