简体   繁体   English

问题映射 <C-[> 到:pop in vim

[英]Issues mapping <C-[> to :pop in vim

I've reassigned the default <CT> mapping for :pop to the CtrlP fuzzy finder, as my Sublime Text use means I hit that instead of <CP> every time. 我已经将:pop的默认<CT>映射重新分配给CtrlP模糊查找器,因为使用Sublime Text意味着我每次都点击而不是<CP> I also use the default <C-]> mapping for Ctags, but when I try to reassign :pop to <C-[> as so: 我也对Ctags使用默认的<C-]>映射,但是当我尝试将:pop分配给<C-[>如下所示:

nmap <C-[> :pop<CR>

the mapping works, and pressing <C-[> correctly pushes me back up the tree, but using the arrow keys now adds random characters into my buffer. 映射有效,按<C-[>正确地将我推回树上,但是现在使用箭头键可以向我的缓冲区添加随机字符。 With that single line commented out the arrow keys work correctly. 用单行注释掉,箭头键可以正常工作。 Anyone have any ideas as to why this mapping would cause this behaviour? 任何人都对为什么这种映射会导致这种行为有任何想法? I can post the full .vimrc and list of plugins used if needed. 我可以发布完整的.vimrc以及需要时使用的插件列表。

The problem is that <C-[> is the same as <Esc> . 问题是<C-[><Esc>相同。

You can check that by entering insert mode and hitting <CV> + <C-[> and <CV> + <C-[> (it is possible that you need to use <CQ> instead of <CV> ). 您可以通过进入插入模式并单击<CV> + <C-[><CV> + <C-[> (可能需要使用<CQ>而不是<CV> ))进行检查。

You should try using a different key, as the Esc is part of the keycode of other keys. 您应该尝试使用其他密钥,因为Esc是其他密钥的密钥代码的一部分。 You may find this link helpful: Vim FAQ: 20.4. 您可能会发现此链接有用: Vim常见问题解答:20.4。 I am not able to create a mapping for the key. 我无法为该键创建映射。 What is wrong? 怎么了?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM