Update
This commit is contained in:
@@ -45,29 +45,12 @@ return {
|
||||
{ condition = tex.in_text }
|
||||
),
|
||||
s(
|
||||
{ trig = "(%d+)bp", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 },
|
||||
{ trig = "#thm", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{homeworkProblem}[Problem <>.]
|
||||
#theorem(<>)[
|
||||
<>
|
||||
\end{homeworkProblem}
|
||||
]],
|
||||
{
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bp", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{homeworkProblem}[Problem <>.]
|
||||
<>
|
||||
\end{homeworkProblem}
|
||||
]
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
@@ -77,26 +60,26 @@ return {
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bff", snippetType = "autosnippet" },
|
||||
{ trig = "#pf", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{proof}
|
||||
#proof[
|
||||
<>
|
||||
\end{proof}
|
||||
]
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin * tex.in_text }
|
||||
{ condition = tex.in_text }
|
||||
),
|
||||
s(
|
||||
{ trig = "bep", snippetType = "autosnippet" },
|
||||
{ trig = "#def", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{problem}[<>]
|
||||
#definition(<>)[
|
||||
<>
|
||||
\end{problem}
|
||||
]
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
@@ -106,332 +89,17 @@ return {
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bex", snippetType = "autosnippet" },
|
||||
{ trig = "#exa", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{exercise}[<>]
|
||||
#example[
|
||||
<>
|
||||
\end{exercise}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bve", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{verbatim}
|
||||
<>
|
||||
\end{verbatim}
|
||||
]
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bbi", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{thebibliography}
|
||||
<>
|
||||
\end{thebibliography}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s({ trig = "bib", snippetType = "autosnippet" }, {
|
||||
t("\\bibitem"),
|
||||
}, { condition = tex.in_bib * line_begin }),
|
||||
s(
|
||||
{ trig = "bfi", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[htbp]
|
||||
\centering
|
||||
\includegraphics[width=0.8\textwidth]{<>}
|
||||
\caption{<>}
|
||||
\label{fig:<>}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
rep(2),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bmf", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[htbp]
|
||||
\centering
|
||||
\begin{minipage}[t]{0.48\textwidth}
|
||||
\centering
|
||||
\includegraphics[width=6cm]{}
|
||||
\caption{}
|
||||
\label{fig:}
|
||||
\end{minipage}
|
||||
\begin{minipage}[t]{0.48\textwidth}
|
||||
\centering
|
||||
\includegraphics[width=6cm]{}
|
||||
\caption{}
|
||||
\label{fig:}
|
||||
\end{minipage}
|
||||
\end{figure}
|
||||
]],
|
||||
{}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "beg", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}[<>]
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
i(0),
|
||||
rep(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "ben", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{enumerate}[<>]
|
||||
\item <>
|
||||
\end{enumerate}
|
||||
]],
|
||||
{
|
||||
i(1, "(a)"),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "blst", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{lstlisting}[language=<>]
|
||||
<>
|
||||
\end{lstlisting}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_text * line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "box", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{framed}
|
||||
<>
|
||||
\end{framed}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_text * line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "dcase", snippetType = "autosnippet", priority = 2000 },
|
||||
fmta(
|
||||
[[
|
||||
\begin{dcases}
|
||||
<>
|
||||
\end{dcases}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
s(
|
||||
{ trig = "case", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{cases}
|
||||
<>
|
||||
\end{cases}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
s(
|
||||
{ trig = "bal", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{aligned}
|
||||
<>
|
||||
\end{aligned}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
s(
|
||||
{ trig = "bal", snippetType = "autosnippet", priority = 2000 },
|
||||
fmta(
|
||||
[[
|
||||
\begin{aligned}
|
||||
<>
|
||||
\end{aligned}
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
s(
|
||||
{ trig = "bit", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{itemize}
|
||||
\item <>
|
||||
\end{itemize}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s({ trig = "im", snippetType = "autosnippet" }, {
|
||||
t("\\item"),
|
||||
}, { condition = tex.in_item * line_begin }),
|
||||
s(
|
||||
{ trig = "bcr", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{center}
|
||||
<>
|
||||
\end{center}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "bta", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{table}[htbp]
|
||||
\centering
|
||||
\begin{tabular}{<>}
|
||||
\hline
|
||||
<>
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{<>}
|
||||
\label{tab:<>}
|
||||
\end{table}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
i(3),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "btr", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{tabular}{<>}
|
||||
\hline
|
||||
<>
|
||||
\hline
|
||||
\end{tabular}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "cha", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\chapter{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "par", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\paragraph{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "sec", snippetType = "autosnippet" },
|
||||
c(1, { sn(nil, { t("\\section{"), i(1), t("}") }), sn(nil, { t("\\section*{"), i(1), t("}") }) }),
|
||||
{ condition = tex.in_text * line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "ssec", snippetType = "autosnippet" },
|
||||
c(1, { sn(nil, { t("\\subsection{"), i(1), t("}") }), sn(nil, { t("\\subsection*{"), i(1), t("}") }) }),
|
||||
{ condition = tex.in_text * line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "sss", snippetType = "autosnippet" },
|
||||
c(1, { sn(nil, { t("\\subsubsection{"), i(1), t("}") }), sn(nil, { t("\\subsubsection*{"), i(1), t("}") }) }),
|
||||
{ condition = tex.in_text * line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "sss", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\subsubsection{<>}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin * line_begin }
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user