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

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

问题描述

Ctrl+CCtrl+[ 有什么区别?这些文件包含我可以找到的以下内容:

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 中使用 CtrlC 的方式与使用 Ctrl 的方式相同会有所帮助C 在 shell 中 - 你想尽快停止你正在做的任何事情并重新获得控制权.所以在 vim 中,如果你使用 CtrlC 退出插入模式,vim 不会费心检查你是否只写了一部分缩写,并且它不会在您每次离开插入模式时运行您的插件为您设置的花哨的自动命令,它只会尽快将您转回正常模式.如果您不使用缩写或自动命令,那么您将不会注意到这种差异.

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天全站免登陆