<C-C> 和有什么区别?和<C-[>在vim中? [英] What is the difference between <C-C> and <C-[> in vim?

查看:22
本文介绍了<C-C> 和有什么区别?和<C-[>在vim中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我学到的使用 vim 的最佳技巧之一是可以按 Ctrl+CCtrl+[ 而不是 Esc 键.但是我使用的是 dvorak 键盘,所以 Ctrl+[ 对我来说也有点遥不可及,所以我主要使用 Ctrl+C.现在我在某处读到这两个组合键实际上并没有完全相同的行为,最好使用 Ctrl+[.不过到目前为止我还没有遇到任何问题,所以我想知道这两者之间到底有什么区别?

One of the best tips for using vim that I have learned so far has been that one can press Ctrl+C or Ctrl+[ instead of the Esc key. However I use a dvorak keyboard so Ctrl+[ is a little out of reach for me as well so I mostly use Ctrl+C. Now I've read somewhere that these two key combinations don't actually have exactly the same behaviour and that it is better to use Ctrl+[. I haven't come across any problems so far though so I'd like to know what exactly is the difference between the two?

推荐答案

根据 Vim 的文档,Ctrl+C 不会检查缩写,也不会触发 InsertLeave 自动命令事件,而 Ctrl+[ 会.

According to Vim's documentation, Ctrl+C does not check for abbreviations and does not trigger the InsertLeave autocommand event while Ctrl+[ does.

一种选择是使用以下重新映射 Ctrl+C

One option is to use the following to remap Ctrl+C

inoremap <C-c> <Esc><Esc>

这篇关于&lt;C-C&gt; 和有什么区别?和&lt;C-[&gt;在vim中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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