Update the UltiSnips snippets

This commit is contained in:
foo-dogsquared 2019-09-30 09:26:57 +08:00
parent 6f37d2c957
commit 711de7d425
2 changed files with 57 additions and 53 deletions

View File

@ -30,6 +30,10 @@ snippet hl "Highlighted text" biw
#$1# $0 #$1# $0
endsnippet endsnippet
snippet a "Hyperlink" iw
${1:<url>}[${2:<text>}] $0
endsnippet
snippet sp "Superscript" biw snippet sp "Superscript" biw
^$1^ $0 ^$1^ $0
endsnippet endsnippet
@ -87,7 +91,7 @@ endsnippet
# Multimedia blocks # Multimedia blocks
snippet figure "Image block with caption" bi snippet figure "Image block with caption" bi
.${2:<caption>} .${2:<caption>}
image::${1:<image path>}[${3:width=100%,height=100%}] image::${1:<image path>}[$2, ${3:width=100%,height=100%}]
$0 $0
endsnippet endsnippet

View File

@ -127,19 +127,19 @@ endsnippet
# Document structure tags # Document structure tags
snippet chapter "Chapter element" bi snippet chapter "Chapter element" bi
\chapter{$1} \chapter{$1}
\label{ch:$1} \label{ch!$1}
$0 $0
endsnippet endsnippet
snippet section "Section tag" bi snippet section "Section tag" bi
\section{$1} \section{$1}
\label{sec:$1} \label{sec!$1}
$0 $0
endsnippet endsnippet
snippet subsec "Subsection tag" bi snippet subsec "Subsection tag" bi
\subsection{$1} \subsection{$1}
\label{subsec:$1} \label{subsec!$1}
$0 $0
endsnippet endsnippet
@ -219,7 +219,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{eq!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2 $2
\end{equation*} \end{equation*}
$0 $0
@ -227,7 +227,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{eq!$1}
$2 $2
\end{equation} \end{equation}
$0 $0
@ -235,7 +235,7 @@ endsnippet
snippet subeq "Subequation environment" biw snippet subeq "Subequation environment" biw
\begin{subequations} \begin{subequations}
\label{eq:$1} \label{eq!$1}
$2 $2
\end{subequations} \end{subequations}
$0 $0
@ -249,12 +249,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{eq!$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{eq!$1}
$2 $2
\end{gathered} \end{gathered}
$0 $0
@ -262,7 +262,7 @@ endsnippet
snippet proof "Proof" biw snippet proof "Proof" biw
\begin{proof} \begin{proof}
\label{proof:$1} \label{proof!$1}
$2 $2
\end{proof} \end{proof}
$0 $0
@ -271,7 +271,7 @@ endsnippet
snippet figure "Figure environment" biw snippet figure "Figure environment" biw
\begin{figure} \begin{figure}
\centering \centering
\label{fig:$1} \label{fig!$1}
$2 $2
\caption{${3:$1}} \caption{${3:$1}}
\end{figure} \end{figure}
@ -296,7 +296,7 @@ snippet graph "Quickly make a graph" bi
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
\caption{$10} \caption{$10}
\label{fig:${11:$10}} \label{fig!${11:$10}}
\end{figure} \end{figure}
$0 $0
endsnippet endsnippet
@ -320,7 +320,7 @@ snippet agraph "Quickly plot a graph without considering integers" bi
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
\caption{$10} \caption{$10}
\label{fig:${11:$10}} \label{fig!${11:$10}}
\end{figure} \end{figure}
$0 $0
endsnippet endsnippet
@ -342,7 +342,7 @@ snippet graph3 "3D graph from pgfplots package" bi
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
\caption{$10} \caption{$10}
\label{fig:${11:$10}} \label{fig!${11:$10}}
\end{figure} \end{figure}
$0 $0
endsnippet endsnippet
@ -965,7 +965,7 @@ snippet lcode "Code listings with label" iw
$2 $2
\end{minted} \end{minted}
`!p snip.rv=smart_space(t[3], "\caption{", loose=True)`$3`!p snip.rv=smart_space(t[3], "}", loose=True)` `!p snip.rv=smart_space(t[3], "\caption{", loose=True)`$3`!p snip.rv=smart_space(t[3], "}", loose=True)`
\label{lst:${4:$3}} \label{code!${4:$3}}
\end{listing} \end{listing}
endsnippet endsnippet
@ -1134,7 +1134,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{def!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2 $2
\end{-doc-definition} \end{-doc-definition}
$0 $0
@ -1142,7 +1142,7 @@ endsnippet
snippet dprop "Doc property block" iw snippet dprop "Doc property block" iw
\begin{-doc-property} \begin{-doc-property}
`!p snip.rv=smart_space(t[1], "\label{prop:", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)` `!p snip.rv=smart_space(t[1], " \label{prop!", loose=True)`$1`!p snip.rv=smart_space(t[1], "}", loose=True)`
$2 $2
\end{-doc-property} \end{-doc-property}
$0 $0