In insert-mode, I would like to extract the current line number I'm editing in a "variable"/memory/buffer, and to be able to paste it through a remapping.
I know that
:echo line(".") gives me the line number.
I have found how to insert the line number at the beginning of each line, using
But I would like to have a remapping like :
:inoremap \l <Esc>:echo line(".") > buffer<CR> p
that would extract the line number and paste it at my current cursor position.
(Sources of previous searches : How to add permanent line numbers to a file?)