Why does having <TAB>
mapped affect <C-I>
? The short answer is, "historical reasons", dating from even before the original 'vi'.
The ASCII code for <TAB>
is 9, same as <CTRL-I>
. Since terminals receive their input encoded in ASCII, they can't tell whether that "TAB" signal came from the actual <TAB>
key, or from the user holding CTRL
and pressing I
. Since Vim was originally written to run on terminals, it can't tell the difference either.
A couple of other pairs of indistinguishable keys are <C-M>
with <Return>
, and <C-[>
with <Esc>
.
It's possible there's some arcane way to tell the difference between the two (more likely if you're using GVim), but if there is, I don't know it. As a workaround, you could use nnoremap <SomeOtherKey> <C-I>
to give <C-I>
's original function to some other key.