One of the best tips for using vim that I have learned so far has been that one can press <C-C> (i.e. CTRL+C) or <C-[> (ie. CTRL+[) instead of the ESC(ape) key. However I use a dvorak keyboard so <C-[> is a little out of reach for me as well so I mostly use <C-C>. Now I've read somewhere that these two key combinations don't actually have exactly the same behaviour and that it is better to use <C-[>. I haven't come across any problems so far though so I'd like to know what exactly is the difference between the two?
+4
A:
According to Vim's documentation, Ctrl+C does not check for abbreviations and does not trigger the |InsertLeave| autocommand event while Ctrl-[ does...
One option is to use the following to remap Ctrl-C
inoremap [C-c] [Esc][Esc]
silvertab
2008-09-17 07:20:28
+3
A:
As it turns out, <C-[>
is exactly identical to Esc, they are the same character. So no need to wonder about any difference there. :)
Greg Hewgill
2008-09-17 07:34:29