0

My .vimrc file looks like this:

noremap <C-[> <NOP>

I would expect this to map the Ctrl + [ key to nothing but instead when I run vim it starts in REPLACE mode. This becomes problematic when I add additional lines to my .vimrc file because they get entered incorrectly.

What is going on? Does this happen for everyone? If so, how can I avoid this behavior?

  • 1
    https://stackoverflow.com/a/21948007/7976758 Found in https://stackoverflow.com/search?q=%5Bvim%5D+Control-Left+Bracket – phd Dec 30 '21 at 11:17

1 Answers1

2

Control-Left Bracket is char #27, i.e. Escape. Don't put two fingers into electrical socket Don't remap it and you won't get weird things going on.

Matt
  • 13,674
  • 1
  • 18
  • 27
  • 2
    To add a bit of information… `` is not only the key you press to leave insert mode. Vim uses the `` *character* a lot under the hood to communicate with the terminal emulator and there even are quite a few keys on your keyboard that send codes containing `` to Vim so disabling it or mapping it to something else is bound to create weird problems. – romainl Dec 30 '21 at 08:44