# How to edit a macro for F5 in Latex Suite

I have an environment for Theorem (aliased to "thm") When in VIM editor I write

"thm" followed by "F5" I get:

\begin{thm}

\end{thm}<++>


Can I edit the macro so that I get instead:

\begin{thm}<++>

\end{thm}<++>


It is the case in many theorems where we want to add the name of the theorem. For example: Roll's theorem....

with the cursor at the beginning?

• Welcome to Vi and Vim! Jun 4 '20 at 17:27
• This is probably a « snippet », so answers will need to figure out how latex suite is handling those Jun 4 '20 at 20:02
• Can you tell us which plugins you have installed? Especially which LatexSuite do you have, because duckduckgo returns several results. Jun 5 '20 at 10:24
• @statox: I am not sure how to answer your question. I downloaded Tex-Suite. Installed under the directory .vim in my home directory. It has a directory called ftplugin, this has a directory called latex-suite, This directory has 32 files and directories. One of them is "envmacros.vim" . I believe that file is the one I need to edit. Jun 5 '20 at 13:56
• @HermanJaramillo My question was about where you downloaded TexSuite because there are several plugins which provide Tex features and to be able to help you we need to know which one exactly you are using. Jun 5 '20 at 15:26

I found the answer to my question. In the "envmacros.vim" file (under ~/.vim/ftplugin/latex-suite) I defined:

let g:Tex_Env_thm = "\\begin{thm}[<++>]\<CR><++>\<CR>\\end{thm}<++>"


then, when I type thm and push < F5> I get:

\begin{thm}[]
<++>
\end{thm}<++>


The cursor located inside the square brackets []. If I do not want to name the theorem, I move with ctrl-j to the inside, and another ctrl-j to exit