1

I wrote a snippet for Sublime text that does the following:

\begin{lemma}

\end{lemma}

and puts the cursor between them. Which works fine. However, if I want to use TAB inside the environment - lets say I want to complete enum - the cursor moves to the line after \end{lemma} and I end up with this

\begin{lemma}
    enum
 \end{lemma}

the cursor is here now.

Is there a way to fix this behaviour?

This is the snippet

<snippet>
<content><![CDATA[
\begin{lemma}
$1
\end{lemma}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>lem</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.tex</scope>
</snippet>

closed as unclear what you're asking by Bobyandbob, TeXnician, Stefan Pinnow, Zarko, Kurt Dec 17 '17 at 21:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    It would be useful to add your snippet. I assume you use a $1 inside your lemma. You can change it to $0 to end the snippet inside the environment instead of having a field inside and end it after the environment. – r-stein Dec 17 '16 at 10:27
  • @r-stein yes you are right I'm using $1. I edited the question to include the snippet. – adham Dec 18 '16 at 16:29
  • if you are using latextools package in sublime and type begin there is already a similar snippet – gtatr Dec 18 '16 at 16:42