简体   繁体   中英

How to map normal mode to modifier key on keyboard in vim (say Alt)?

I want to make my workflow in vim a little bit faster for me, by working all the time in insert mode, with executing normal mode commands(keybindings), when I hold some modifier key, say alt.

So, for example, I'm currently in insert mode and I want to call undo command, instead of typing <Esc> <u> <i> , I want to type <Alt>+<u> , and return to insert mode immediately.

I know, you can map all your mappings via imap/inoremap explicitly for every insert mode mapping, but I want to map ALL the normal mode mappings, even those used in my plugins, and this is too much work. Also, I know there's <Ctrl>+<o> command to execute only one command in normal mode with returning to starting mode right after, but I want to be able to execute any number of commands in insert mode, not just one, and not to execute any, if I just hold <Alt> key (or any modifier I set for this behavior) and then release, not switching to normal mode.

PS if someone heard about vim-clutch , I want to make the same, not buying extra one pedal for release event, having only one pedal.

thx.

好吧,我已经找到了自己的解决方案- 这篇博客文章通过使用libusb gem深入介绍了所有内容。

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