Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I've become far too trained to use <C-C> to return to normal mode. I understand there is a difference between <C-C> and <ESC> but that's beside the point of this question.

I use the mapping nnoremap <C-C> <silent> <C-C> so I don't see the message "Type :quit<Enter> to exit vim" when pressing <C-C> in normal mode.

When in normal mode and pressing r I can't cancel with <C-C>, instead it will just insert the non printable character. Is there a way to change this behavior?

share|improve this question
    
Your <C-C> is Ctrl+C, right? –  slm Aug 21 '14 at 8:19
    
I've updated the question –  Evan Purkhiser Aug 21 '14 at 8:38

1 Answer 1

up vote 2 down vote accepted

First, that

nnoremap <C-C> <silent> <C-C>

has the <silent> parameter in the wrong position; it works, but not the way you think it does (and it beeps). Better use this:

nnoremap <C-C> <Nop>

To avoid the insertion of ^C when aborting r, define a special mapping for that, too:

nnoremap r<C-c> <Nop>
share|improve this answer
    
This looks good to me! Thanks! –  Evan Purkhiser Aug 25 '14 at 18:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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