简体   繁体   中英

Vim imap jk <Esc> not working

In my vimrc, I've remapped jk to escape using imap.

The problem emerges when I use jk; it doesn't escape, it only echoes out <Esc> .

Here's the entry in quiestion: imap jk <Esc>

It's also a good point to make that I'm also using vim-X11 in fedora.

It looks like your 'cpoptions' settings contains < ; then, special key codes like <Esc> are not recognized.

Find out where this got set via

:verbose set cpo?

or re-write the mapping to use a literal Escape character; enter it via Ctrl + V Esc ; it should appear as ^[ in the buffer.


PS: Though not related, you should usually use :inoremap unless remapping is required.

对于因标题而在这里的人,jk映射在以下情况下也不起作用:set paste启用:set paste

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