I have recently found out that Ctrl+C can be used instead of Esc in certain instances. Getting out of insert mode for instance. Other things can only exclusively exited using escape.
So my question is, is it possible to completely replace the escape key with Ctrl+C? So that it works exactly the same?


2 Answers 2


There are some (often subtle) differences between Esc and CTRL+C to leave Insert mode.

For instance, :help i_CTRL-C mentions some of them:

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

Another difference happens when you enter Insert mode with a count, in which case CTRL+C will cancel the repetition from the count. To illustrate, 3iabc<Esc> will insert abcabcabc, while 3iabc<C-c> will insert simply abc.

If you want to make CTRL+C exactly equivalent to Esc, you can use a mapping to do so:

imap <C-c> <Esc>

Another option (if you're looking for a replacement for the Esc key, either because your keyboard doesn't have one or because you find its location inconvenient) is to use CTRL+[, which is exactly equivalent to Esc, it produces the exact same keystroke so both key combinations are effectively indistinguishable to Vim.

  • Yeah problem is, my keyboard layout makes control-] unreachable. Is there really no way to just remap it to c-c Jun 6, 2020 at 18:19
  • 1
    @user2741831 Yes there is, see the answer, imap <C-c> <Esc> might be exactly what you want to make <C-c> behave exactly like <Esc>. You might want to also map that in other modes (Visual, Select, etc.) Perhaps in all modes: map <C-c> <Esc> and map! <C-c> <Esc> will do that.
    – filbranden
    Jun 6, 2020 at 18:21
  • 2
    Any reason not to noremap instead of map?
    – D. Ben Knoble
    Jun 7, 2020 at 12:34
  • 3
    @filbranden kind of? The mapping being recursive only means remapping escape also affects ctrl-c..
    – D. Ben Knoble
    Jun 7, 2020 at 13:53
  • 1
    @filbranden Note that it's quite easy in all OSes to swap CapsLock and Escape. It's a solution adopted by a lot of vimmers and makes life much easier.
    – cassepipe
    Jan 12 at 13:58

I do not think it is good idea to use CTRL-C instead of ESC since it does not do some useful things like following (from :h i_CTRL-C) and can break some plugins.

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

But if really want it you can remap:

inoremap <ESC> <C-C>

Also you maybe want to know that <C-[> is equal to <ESC>. And if you worry about speed of typing think about this mapping:

inoremap jj <Esc>
  • 1
    Note that your first inoremap is backwards, you're mapping Esc to Ctrl-C and not Ctrl-C to Esc. With the second mapping, you might want to explain what that does and why you'd use that, it might not be obvious to a beginner...
    – filbranden
    Jun 7, 2020 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.