I would like to make a keybind that will let the user type something in insert mode, then goes to a different line, and puts what the user typed there. The purpose of this is for LaTeX \begin and \end. This is what I have so far:
autocmd Filetype tex inoremap `d \begin{}<CR><++><CR>\end{}<esc>2kf{a
At the end, a lets the user type in the \begin field, and I want to make it so that, when I exit insert mode, what I typed is put into the \end field. I honestly have no idea how to go about this. Any help is appreciated.