Update UltiSnips snippets for my TeX files

This commit is contained in:
foo-dogsquared 2019-10-04 00:29:20 +08:00
parent a7ca930058
commit 28d6b892b3

View File

@ -7,6 +7,7 @@ texMathZoneIds = vim.eval('map('+str(texMathZones)+", 'hlID(v:val)')")
texIgnoreMathZoneIds = vim.eval('map('+str(texIgnoreMathZones)+", 'hlID(v:val)')") texIgnoreMathZoneIds = vim.eval('map('+str(texIgnoreMathZones)+", 'hlID(v:val)')")
ignore = texIgnoreMathZoneIds[0] ignore = texIgnoreMathZoneIds[0]
labelPrefix = "!"
def math(): def math():
synstackids = vim.eval("synstack(line('.'), col('.') - (col('.')>=2 ? 1 : 0))") synstackids = vim.eval("synstack(line('.'), col('.') - (col('.')>=2 ? 1 : 0))")
@ -133,13 +134,13 @@ endsnippet
snippet section "Section tag" bi snippet section "Section tag" bi
\section{$1} \section{$1}
\label{sec!$1} \label{sect!$1}
$0 $0
endsnippet endsnippet
snippet subsec "Subsection tag" bi snippet subsec "Subsection tag" bi
\subsection{$1} \subsection{$1}
\label{subsec!$1} \label{subsect!$1}
$0 $0
endsnippet endsnippet
@ -165,40 +166,60 @@ snippet ref "Create a reference for a label" bi
\ref{${1:<label to be referenced>}} $0 \ref{${1:<label to be referenced>}} $0
endsnippet endsnippet
snippet eqref "Quick equation reference command" wi snippet algoref "Quick algorithm reference command" wi
Equation \ref{eq:$1} $0 Algorithm \ref{algo!$1} $0
endsnippet endsnippet
snippet theoref "Quick theorem reference command" wi snippet chapref "Quick chapter reference command" wi
Theorem \ref{th:$1} $0 Chapter \ref{chap!$1} $0
endsnippet
snippet coderef "Quick code reference command" wi
Code \ref{code!$1} $0
endsnippet
snippet defnref "Quick definition reference command" wi
Definition \ref{defn!$1} $0
endsnippet endsnippet
snippet figref "Quick figure reference command" wi snippet figref "Quick figure reference command" wi
figure \ref{fig:$1} $0 Figure \ref{fig!$1} $0
endsnippet endsnippet
snippet tabref "Quick table referenece command" wi snippet listref "Quick list reference command" wi
table \ref{tab:$1} $0 List \ref{list!$1} $0
endsnippet endsnippet
snippet chref "Quick chapter reference command" wi snippet mathref "Quick mathematics reference command" wi
chapter \ref{ch:$1} $0 Equation \ref{math!$1} $0
endsnippet endsnippet
snippet secref "Quick section reference command" wi snippet partref "Quick part reference command" wi
section \ref{sec:$1} $0 Part \ref{part!$1} $0
endsnippet endsnippet
snippet subsecref "Quick subsection reference command" wi snippet proofref "Quick proof reference command" wi
subsection \ref{subsec:$1} $0 Proof \ref{proof!$1} $0
endsnippet endsnippet
snippet propref "Quick property reference command" wi snippet propref "Quick property reference command" wi
Property \ref{prop:$1} $0 Property \ref{prop!$1} $0
endsnippet endsnippet
snippet defref "Quick definition reference command" wi snippet secref "Quick section reference command" wi
Definition \ref{def:$1} $0 Section \ref{sect!$1} $0
endsnippet
snippet subsecref "Quick subsection reference command" wi
Subsection \ref{subsect!$1} $0
endsnippet
snippet tabref "Quick table referenece command" wi
Table \ref{table!$1} $0
endsnippet
snippet theoref "Quick theorem reference command" wi
Theorem \ref{theorem!$1} $0
endsnippet endsnippet
snippet foot "Footnote" w snippet foot "Footnote" w
@ -219,7 +240,7 @@ endsnippet
snippet mb "Math block" bi snippet mb "Math block" bi
\begin{equation*} \begin{equation*}
`!p snip.rv=smart_space(t[1], " \label{eq!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)` `!p snip.rv=smart_space(t[1], " \label{math!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2 $2
\end{equation*} \end{equation*}
$0 $0
@ -227,7 +248,7 @@ endsnippet
snippet eq "Equation environment for mathematical typesetting" biw snippet eq "Equation environment for mathematical typesetting" biw
\begin{equation} \begin{equation}
\label{eq!$1} \label{math!$1}
$2 $2
\end{equation} \end{equation}
$0 $0
@ -235,7 +256,7 @@ endsnippet
snippet subeq "Subequation environment" biw snippet subeq "Subequation environment" biw
\begin{subequations} \begin{subequations}
\label{eq!$1} \label{math!$1}
$2 $2
\end{subequations} \end{subequations}
$0 $0
@ -249,12 +270,12 @@ $0
endsnippet endsnippet
snippet alignli "Quick align equation with label" biw snippet alignli "Quick align equation with label" biw
${1:<LHS>} &= ${2:<RHS>} \label{eq!$3} \\ $4 ${1:<LHS>} &= ${2:<RHS>} \label{math!$3} \\ $4
endsnippet endsnippet
snippet gathered "Gathered environment which lets you gather a bunch of equations and assign them under one equation number" bi snippet gathered "Gathered environment which lets you gather a bunch of equations and assign them under one equation number" bi
\begin{gathered} \begin{gathered}
\label{eq!$1} \label{math!$1}
$2 $2
\end{gathered} \end{gathered}
$0 $0
@ -1134,7 +1155,7 @@ endsnippet
snippet ddef "Doc definition block" iw snippet ddef "Doc definition block" iw
\begin{-doc-definition} \begin{-doc-definition}
`!p snip.rv=smart_space(t[1], " \label{def!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)` `!p snip.rv=smart_space(t[1], " \label{defn!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2 $2
\end{-doc-definition} \end{-doc-definition}
$0 $0