I am trying to map ctrl+shift+i to insert an italics command in LaTeX files, and here's my attempt:
autocmd BufNewFile,BufRead,BufWrite *.tex inoremap <buffer> <c-I> \textit{}^[i
I am using these three Buf event versions, because Filetype tex simply doesn't seem to recognize LaTeX files (I am sure I am doing something wrong).
In any case, the mapping above causes the Tab key to have the effect which I seemingly have mapped ctrl+shft+i to have, and I have no idea why.
<C-i>is the tab character; on my terminal; see the text on https://bestasciitable.com for a bit of an explanation. On my terminal,<C-i>and<C-S-i>both generate a tab, but<S-i>generates<Esc>[Z. You can check by pressing<C-v>and then your keybinding (works in Vim insert mode, but also most shells) which inserts the "raw" characters the terminal sends. Mapping letters with both Ctrl+Shift can be tricky in general; see Can I map a Ctrl + upper-case letter separately from Ctrl + lower-case letter? – Martin Tournoij Jun 06 '22 at 07:54