0

When in insert mode, if no mapping is associated to a sequence, Vim will print the character corresponding to the signal.
For example, typing <c-b> will input ^b as a character.

It is more annoying in command mode. For exemple, when I type filetype de<c-i>, the completion will not work and I will have filetype de^I.

I found out there is an option to prevent this in bash readline:

   echo-control-characters (On)
      When set to On, on operating systems that indicate  they  support  it,
      readline  echoes  a character corresponding to a signal generated from
      the keyboard.

Is there such a setting in Vim?

Edit: added the command mode part (which I just remembered was what always really bothered me in the first place).

  • 1
    Just curious, why do you need it ? – dedowsdi May 16 at 14:06
  • Out of pure laziness, not to have to delete them when I mistype, of course! And since it exists in bash, I was wondering if it was implemented in Vim too. – Biggybi May 16 at 15:26
1

Very few control characters are actually passed through in insert mode. You can easily remap them to <nop> (do nothing) or anything more useful;

inoremap <c-b> <nop>
inoremap <c-f> <nop>
inoremap <c-l> <nop>
inoremap <c-z> <nop>
| improve this answer | |
  • That's a workaround indeed. – Biggybi May 16 at 15:28
  • I just remembered why this question was so important to me...I edited it. – Biggybi May 17 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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