How to toggle between vim-emulation and no-vim-emulation when the vscodevim extension is installed?

前端 未结 2 1837
暖寄归人
暖寄归人 2021-02-13 14:17

I haven\'t found a way to quickly do this without having to entirely disable the extension in the \"Extensions\" panel. In IntelliJ IDEA, one can easily toggle on/off the emulat

相关标签:
2条回答
  • 2021-02-13 14:30

    This answer is an extension to the previous answer.

    You can use a keyboard shorcut for toggleVim command with the help of keybindings in VS code.

    For example, here I want to use Ctrl+Alt+V to toggle Vim mode on/off. To do this I add the following to keybindings.json and save the file.

        {
            "key": "ctrl+alt+v",
            "command": "toggleVim"
        }
    

    You can open keybindings.json from command palette Ctrl+Shift+P, >Preferences: Open Keyboard Shortcuts (JSON).

    Please note, you have to be careful to choose only from unused keybindings in Vim and VS code. Alt key combinations are unused in Vim.

    0 讨论(0)
  • 2021-02-13 14:36

    VSCode has the same command system as atom. These commands can be started through the "command palette" and also bound to a key-combo.

    The corresponding command is toggleVim. You can bind this command to a key using the gear-icon > keyboard combos (sry, i don't know how to switch the language for an exact description :) ) > enter "toggleVim" to the searchbar. Then you can assign a combo to it.

    Effectively the extension will be disabled or enabled quickly.

    0 讨论(0)
提交回复
热议问题