Created
September 16, 2014 19:35
-
-
Save rudvfaden/c68002520962a24cb073 to your computer and use it in GitHub Desktop.
Sublime snippet for LaTeX environments with matching and self adjusting comment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
%========== ${1/(.+)/\U\1/g}: ${2:Description} ==========% | |
\begin{${1:Environment}} | |
$3 | |
\end{${1:Environment}} | |
%=============${1/./=/g}=${2/./=/g}============% | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>cenv</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>text.tex.latex</scope> | |
<!-- Optional: Description to show in the menu --> | |
<description>Enviroment with comment</description> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This snippet inserts a LaTeX environment wrapped in a comment where the first part of the comment i automatically filled and capitalized from the environment. The description part must be filled manually.
Example
The snippet is inserted with
cenv+tab
. When first inserted, the snippet will look like this:But after filling the
Environment
placeholder, the snippet will self adjust in with and the first part of the comment is filled and capitalized