Ctrl + C和Ctrl + [有什么区别? [英] What's the difference between Ctrl+C and Ctrl+[?

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

问题描述

Ctrl + C Ctrl + ["有什么区别?这些文档包含以下内容:

What's the difference between Ctrl+C and Ctrl+[? The documents contain the following that I can find:

<Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode.  Finish
                abbreviation.           
                Note: If your <Esc> key is hard to hit on your keyboard, train
                yourself to use CTRL-[.

CTRL-C          Quit insert mode, go back to Normal mode.  Do not check for
                abbreviations.  Does not trigger the |InsertLeave| autocommand
                event.

CTRL-C                  Interrupt current (search) command.  Use CTRL-Break on
                        MS-DOS |dos-CTRL-Break|.
                        In Normal mode, any pending command is aborted.

对于命令的确切功能似乎有些分歧.

It seems there is some disagreement to what exactly the commands do.

Ctrl + C 是否也不会退出替换模式,缩写与待处理命令有何关系?

Does Ctrl+C not also leave Replace mode, and how do abbreviations relate to pending commands?

推荐答案

在vim中有助于想到 Ctrl C 就像您想到 Ctrl一样 C 在shell中-您想尽快停止所做的一切并获得控制权.因此,在vim中,如果您使用 Ctrl C 退出插入模式,则vim不会费心检查您是否只写了缩写的一部分,并且它不会在每次退出插入模式时运行插件设置的高级自动命令,只会尽快将您转回正常模式.如果您没有使用缩写词或autocmds,那么您将不会注意到这种差异.

It helps to think of CtrlC in vim the same way you think of CtrlC in a shell - you want to stop whatever you were doing ASAP and get control back. So in vim, if you're using CtrlC to break out of insert mode, vim isn't going to bother checking if you just wrote part of an abbreviation, and it isn't going to run the fancy auto commands your plugins have set up for every time you leave insert mode, it's just going to dump you back in normal mode as soon as it can. If you're not using abbreviations or autocmds, then you're not going to notice this difference.

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

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