0

So I want to remap "i" to escape key since i find it easier to remember. But when I do this to settings.json of the VS Code:

"vim.normalModeKeyBindings": [
     {
        "before": [
            "i"
        ],
        "after": [
           "<Esc>"
        ]
     }
] 

The "i" key is disabled and nothing happens. Just the "i" key in insert mode being disabled. Help, I'm new to vim.

4

1 回答 1

1

In Vim, the i keybinding is used to go into insert mode from normal mode. The esc key is usually used to go into normal mode. Setting i as esc is definitely an anti-pattern. Usually people set CapsLock as esc key since it's nearer to the home row in keyboard and you don't have to reach as far as esc key, and since it's annoying sometimes. I have also seen some people using jj over esc.

Nevertheless, to answer your question, just open Preferences: Open Keyboard Shortcut from command palette(Ctrl+Shift+p) and search for vim_escape. Then double click on it and enter the key i and then press enter again. That should get you the desired result.

Again, suggesting you to not go ahead with this remapping.

于 2021-04-03T06:29:22.187 回答