I want to automate some routine operations when working with LaTeX documents writing, e.g. I often write these lines:
\begin{<environment-name>}
some text and commands here
\end{<environment-name>}
Where <environment-name> is different environments (e.g. enumerate, description, and many others).
When I start \begin{<environment-name>}, I want to make vim (neovim) automatically add \end{<environment-name>} at the next line and return the cursor back, right after \begin{<environment-name>}. What vim script I can use to automate it?
I already checked this answer but it doesn't work for me, since it's about new command, not auto insertion of text.
]]. – Karl Yngve Lervåg Nov 06 '20 at 13:44