When using vi, you can exit insert mode with Ctrl + C instead of the more traditional Esc. Are there any situations where it would be undesirable to use for former instead of the latter? Does it break anything other than best practice?

  • It is undesirable to hit the former by accident, which gets you an error-like Type :quit<Enter> to exit Vim and made me Google how to get back. Hitting i gets you right back to insert mode.
    – Noumenon
    Apr 12, 2017 at 17:09

3 Answers 3


Ctrl-C and Esc are not the same in vi/vim in most modes, including insert mode. The difference is Esc triggers abbreviations while Ctrl-c does not. Whether this matters to you depends on whether you or any plugins you use make use of abbreviations.

Note that it is safer to assume Esc and Ctrl-C do not mean the same thing in vim. Another example from this same site is when exiting block insert mode (not in vi).

  • Good to know, but my question was about exiting insert mode.
    – MDMarra
    Nov 2, 2012 at 13:52
  • @MDMarra Doh, misread your question. Insert mode is still different: see updated answer.
    – jw013
    Nov 2, 2012 at 13:54
  • 1
    Here's the most important difference I've had to deal with: multiline insert with visual block mode works with Esc and not with C-c. Dec 2, 2017 at 18:30

If you're referring to vim, there is a slight difference. CTRL-C does not check for abbreviations, and it does not trigger the InsertLeave event. So if your plugins have defined any autocmd statements that depend on InsertLeave, they won't get triggered.

From the official documentation http://vimhelp.appspot.com/insert.txt.html :

<Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode.  Finish

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

You can define a mapping for CTRL-C to <esc>, then it will trigger InsertLeave.


I think you mean vim, not vi.

This does indeed work in vim, though I wouldn't use it unless I was 100% sure I would never touch a non-Linux operating system, ever. The reason is that other OSes may have their own implementations of vi, which do not implement this, and you might find that when running vi on those platforms, Ctrl-C has its own traditional behavior: interrupt the process and leave your terminal in a weird state.

  • 3
    Can you point to any vi implementation that still exists today that doesn't handle Ctrl-C? See my answer for the real difference.
    – jw013
    Nov 2, 2012 at 13:47
  • @jw013 I guess this answer switches the terminal with vim in a terminal. I do not think that there is another vi/vim anywhere that can interrupt the terminal's process since even in a vim that is embedded in the terminal, you are either in vim mode, or you are not. You cannot just have terminal and vim at the same time. In Alacritty which embeds vim, you press Ctrl+Space to enter the vim mode. I do not see why there should be any vi/vim on any OS out there that will interrupt a terminal process when you press Ctrl+C. May 26, 2022 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .