Add tabstop in python expression in UltiSnip
<p>I made a modification of the example given by UltiSnip doc:</p>

<pre><code>snippet "be(gin)?( (\S+))?" "begin{} / end{}" br
\begin{${1:`!p
snip.rv = match.group(3) if match.group(2) is not None else "something"`}}${2:`!p
if match.group(2) is not None and match.group(3) != "proof":
    snip.rv = "\label{"+t[1]+":}"`}
    ${3:${VISUAL}}
\end{$1}$0
endsnippet
</code></pre>

<p>which, compared to the original one add a <code>\label{envname:}</code> and if the <code>envname</code> is <code>proof</code> then we didn't add it. This can be helpful when we write <code>thm</code> environment, e.g.</p>

<p><code>be lem&lt;tab&gt;</code> will give </p>

<p><code>\begin{lem}\label{lem:}
 &lt;c-j&gt;
\end{lem}
</code>
the only drawback is that, I don't know how to add a placeholder at the position <code>\label{lem:$4}</code>. Any idea?</p>

<p>I get a work version, but not clean in code:</p>

<p><code>snippet "be(gin)?( (\S+))?" "begin{} / end{}" br
\begin{${1:`!p
snip.rv = match.group(3) if match.group(2) is not None else "something"`}}${2:`!p
if match.group(2) is not None and match.group(3) != "proof":
    snip.rv = '\label{'+t[1]+':'`$4`!p
if match.group(2) is not None and match.group(3) != "proof":
    snip.rv ='}'`}
    ${3:${VISUAL}}
\end{$1}$0
endsnippet
</code></p>

python vim-plugin ultisnips