The question
When editing TeX files (to do so, I use vimtex) if I've discovered that if I write lll
in insert mode, I get \ell
.
How do I find why this is happening?
My research
I thought "ok, I'll find out where this mapping or abbreviation is and whther vimtex or something else creates it".
I've checked :ab lll
and all :*map lll
, and the culprit turns out to be lmap
, as the output of :verbose lmap lll
is the following:
Kitty keyboard protocol: Cleared
l l * L
Last set from ~/.vimrc line 654
And that line is where the following function is defined,
for c in range(char2nr('A'), char2nr('Z'))
exe 'lnoremap ' . nr2char(c+32) . ' ' . nr2char(c)
exe 'lnoremap ' . nr2char(c) . ' ' . nr2char(c+32)
endfor
which I took from here eons ago (and which comes with autocmd InsertLeave * set iminsert=0
too).
But how is that causing the behavior I described above? And why only when filetype
is tex
???
Well the answer is that it is not, because if I delete that stuff the issue persists. After all, the output of :verbose lmap lll
is not really telling me that lll
is mapped to anything. Just that l
is, and that's ok. Indeed, deleting the for
loop above, :verbose lmap lll
too gives no result.
So I'm left with :ab lll
and all of :*map lll
giving no output.
Where does this behavior come from?