简体   繁体   中英

Have to press “I” and spacebar to switch to insert mode in Vim

I have to press "i" and an extra spacebar in order to switch to Insert mode in Vim, which is pretty annoying.

示例图片

You can see there are 5 "i"s on the screen in Normal mode, if I press spacebar, Vim will switch to Normal mode and 4 "i"s will be added to the file.

It has the same problem for "a", "s", "o" and other command key.

Please help.

Based on the underlining, this looks like a temporary input buffer of an IME (Input Method Editor; to insert non-English characters with a standard keyboard). The application (Vim) doesn't see the characters until you complete the composition (with the Space key). Only then does Vim receive the characters, and processes them.

You need to turn off the IME, at least for the terminal / Vim. There's usually an icon in the systray where you can select the input method, and often a keyboard shortcut like Super + Space toggles the state of it. Vim can interact with the IME, too, and only use its services for insert mode (to be able to write in Unicode scripts). Read more about it in :help mbyte-XIM (Linux) and :help mbyte-IME (Windows).

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