[英]Vim imap jk <Esc> not working
In my vimrc, I've remapped jk to escape using imap. 在我的vimrc中,我重新映射jk以逃避使用imap。
The problem emerges when I use jk; 当我使用jk时出现问题; it doesn't escape, it only echoes out
<Esc>
. 它没有逃脱,它只是回响
<Esc>
。
Here's the entry in quiestion: imap jk <Esc>
这是quiestion中的条目:
imap jk <Esc>
It's also a good point to make that I'm also using vim-X11 in fedora. 这也是一个很好的观点,我也在Fedora中使用vim-X11。
It looks like your 'cpoptions'
settings contains <
; 看起来您的
'cpoptions'
设置包含<
; then, special key codes like <Esc>
are not recognized. 那么,无法识别像
<Esc>
这样的特殊键码。
Find out where this got set via 找出这个设置的位置
:verbose set cpo?
or re-write the mapping to use a literal Escape character; 或重写映射以使用文字Escape字符; enter it via Ctrl + V Esc ;
通过Ctrl + V Esc输入; it should appear as
^[
in the buffer. 它应该显示为
^[
在缓冲区中。
PS: Though not related, you should usually use :inoremap
unless remapping is required. PS:虽然不相关,但通常应使用
:inoremap
除非需要重新映射。
对于因标题而在这里的人,jk映射在以下情况下也不起作用:set paste
启用:set paste
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.