是否可以映射 <C-;>: 在 vi​​m 中? [英] Is it possible to map <C-;> to : in vim?

查看:22
本文介绍了是否可以映射 <C-;>: 在 vi​​m 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用大写锁定作为控件,因此用作 : 更自然,但 noremap <C-;>: 不起作用.在vim中可以做这样的映射吗?

解决方案

来自 Vim FAQ(也可以通过这个不错的插件获得):

20.4.我无法为 <xxx> 创建映射.钥匙.怎么了?1) 首先确保密钥正确传递给 Vim.确定是否在这种情况下,将 Vim 置于插入模式,然后按 Ctrl-V(或Ctrl-Q 如果您的 Ctrl-V 被重新映射到粘贴操作(例如Windows(如果您使用的是 mswin.vim 脚本文件),然后是您的钥匙.如果缓冲区中没有出现任何内容(并假设您有'showcmd' 开启,^V 仍然显示在 Vim 的右下角附近屏幕),那么 Vim 无法正确获取您的密钥,并且什么也没有完成,除了为您的映射选择不同的键或使用 GVim,它应该正确识别密钥.

<C-;>尝试上面的内容,显示它没有被vim/gvim捕获...<​​/p>

I use capslock as control so it is more natural to use as : but noremap <C-;> : does not work. Is it possible to do such mapping in vim?

解决方案

From Vim FAQ (also available through this nice plugin):

20.4. I am not able to create a mapping for the <xxx> key. What is wrong?

1) First make sure, the key is passed correctly to Vim. To determine if
   this is the case, put Vim in Insert mode and then hit Ctrl-V (or
   Ctrl-Q if your Ctrl-V is remapped to the paste operation (e.g. on
   Windows if you are using the mswin.vim script file) followed by your
   key.

   If nothing appears in the buffer (and assuming that you have
   'showcmd' on, ^V remains displayed near the bottom right of the Vim
   screen), then Vim doesn't get your key correctly and there is nothing
   to be done, other than selecting a different key for your mapping or
   using GVim, which should recognise the key correctly.

Trying the above with <C-;> shows that it is not captured by vim/gvim...

这篇关于是否可以映射 &lt;C-;&gt;: 在 vi​​m 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆