mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-01-30 22:57:54 +00:00
Update the UltiSnips snippets
This commit is contained in:
parent
6f37d2c957
commit
711de7d425
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ endsnippet
|
|||||||
# Common environments
|
# Common environments
|
||||||
snippet begin "Simple empty environment" bi
|
snippet begin "Simple empty environment" bi
|
||||||
\begin{$1}
|
\begin{$1}
|
||||||
$2
|
$2
|
||||||
\end{$1}
|
\end{$1}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
@ -219,69 +219,69 @@ 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
|
||||||
endsnippet
|
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
|
||||||
endsnippet
|
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
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet align "Align equations environment" biw
|
snippet align "Align equations environment" biw
|
||||||
\begin{align}
|
\begin{align}
|
||||||
$1
|
$1
|
||||||
\end{align}
|
\end{align}
|
||||||
$0
|
$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
|
||||||
endsnippet
|
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
|
||||||
endsnippet
|
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}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet graph "Quickly make a graph" bi
|
snippet graph "Quickly make a graph" bi
|
||||||
\begin{figure}[${1:ht}]
|
\begin{figure}[${1:ht}]
|
||||||
\centering
|
\centering
|
||||||
\begin{tikzpicture}
|
\begin{tikzpicture}
|
||||||
\begin{axis}[
|
\begin{axis}[
|
||||||
xlabel=${2:$x$},
|
xlabel=${2:$x$},
|
||||||
ylabel=${3:$y$},
|
ylabel=${3:$y$},
|
||||||
@ -292,19 +292,19 @@ snippet graph "Quickly make a graph" bi
|
|||||||
major tick style=thick,
|
major tick style=thick,
|
||||||
domain=${4:-10}:${5:10},`!p snip.rv = smart_space(t[6], "\n\t", loose=True)`$6
|
domain=${4:-10}:${5:10},`!p snip.rv = smart_space(t[6], "\n\t", loose=True)`$6
|
||||||
]
|
]
|
||||||
\addplot[samples=${7:`!p snip.rv = add_variable_numbers(t[4], t[5], 1, absolute=True)`},$8]{${9:x}};
|
\addplot[samples=${7:`!p snip.rv = add_variable_numbers(t[4], t[5], 1, absolute=True)`},$8]{${9:x}};
|
||||||
\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
|
||||||
|
|
||||||
snippet agraph "Quickly plot a graph without considering integers" bi
|
snippet agraph "Quickly plot a graph without considering integers" bi
|
||||||
\begin{figure}[${1:ht}]
|
\begin{figure}[${1:ht}]
|
||||||
\centering
|
\centering
|
||||||
\begin{tikzpicture}
|
\begin{tikzpicture}
|
||||||
\begin{axis}[
|
\begin{axis}[
|
||||||
xlabel=${2:$x$},
|
xlabel=${2:$x$},
|
||||||
ylabel=${3:$y$},
|
ylabel=${3:$y$},
|
||||||
@ -316,11 +316,11 @@ snippet agraph "Quickly plot a graph without considering integers" bi
|
|||||||
minor tick num=2,
|
minor tick num=2,
|
||||||
domain=${4:-10}:${5:10},`!p snip.rv=smart_space(t[6], "\n\t", loose=True)`$6
|
domain=${4:-10}:${5:10},`!p snip.rv=smart_space(t[6], "\n\t", loose=True)`$6
|
||||||
]
|
]
|
||||||
\addplot[samples=${7:`!p snip.rv=add_variable_numbers(t[4], t[5], absolute=True)`}, $8]{${9:x}};
|
\addplot[samples=${7:`!p snip.rv=add_variable_numbers(t[4], t[5], absolute=True)`}, $8]{${9:x}};
|
||||||
\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
|
||||||
@ -338,11 +338,11 @@ snippet graph3 "3D graph from pgfplots package" bi
|
|||||||
major tick style=thick,
|
major tick style=thick,
|
||||||
domain=${4:-10}:${5:10},`!p snip.rv = smart_space(t[6], "\n\t", loose=True)`$6
|
domain=${4:-10}:${5:10},`!p snip.rv = smart_space(t[6], "\n\t", loose=True)`$6
|
||||||
]
|
]
|
||||||
\addplot3[samples=${7:`!p snip.rv = add_variable_numbers(t[4], t[5], 1, absolute=True)`},$8]{${9:x}};
|
\addplot3[samples=${7:`!p snip.rv = add_variable_numbers(t[4], t[5], 1, absolute=True)`},$8]{${9:x}};
|
||||||
\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
|
||||||
@ -918,14 +918,14 @@ endsnippet
|
|||||||
|
|
||||||
snippet ol "Enumerated list (ordered list)" iw
|
snippet ol "Enumerated list (ordered list)" iw
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
$1
|
$1
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ul "Itemized list (unordered list)" iw
|
snippet ul "Itemized list (unordered list)" iw
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
$1
|
$1
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
@ -951,7 +951,7 @@ endsnippet
|
|||||||
|
|
||||||
snippet code "Code listings with Minted package" iw
|
snippet code "Code listings with Minted package" iw
|
||||||
\begin{minted}
|
\begin{minted}
|
||||||
$3
|
$3
|
||||||
\end{minted}
|
\end{minted}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
@ -961,11 +961,11 @@ endsnippet
|
|||||||
# https://tex.stackexchange.com/a/254177
|
# https://tex.stackexchange.com/a/254177
|
||||||
snippet lcode "Code listings with label" iw
|
snippet lcode "Code listings with label" iw
|
||||||
\begin{listing}[H]
|
\begin{listing}[H]
|
||||||
\begin{minted}{${1:<language>}}
|
\begin{minted}{${1:<language>}}
|
||||||
$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
|
||||||
|
|
||||||
@ -1113,58 +1113,58 @@ endsnippet
|
|||||||
# * fontawesome
|
# * fontawesome
|
||||||
snippet dnote "Doc note admonition block" iw
|
snippet dnote "Doc note admonition block" iw
|
||||||
\begin{-doc-note}
|
\begin{-doc-note}
|
||||||
$1
|
$1
|
||||||
\end{-doc-note}
|
\end{-doc-note}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet dinfo "Doc info admonition block" iw
|
snippet dinfo "Doc info admonition block" iw
|
||||||
\begin{-doc-info}
|
\begin{-doc-info}
|
||||||
$1
|
$1
|
||||||
\end{-doc-info}
|
\end{-doc-info}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet dtheo "Doc theorem block" iw
|
snippet dtheo "Doc theorem block" iw
|
||||||
\begin{-doc-theorem}{${1:<Theorem title>}}{${2:<marker>}}
|
\begin{-doc-theorem}{${1:<Theorem title>}}{${2:<marker>}}
|
||||||
$3
|
$3
|
||||||
\end{-doc-theorem}
|
\end{-doc-theorem}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
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
|
||||||
endsnippet
|
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
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet dwarn "Doc warning callout block" iw
|
snippet dwarn "Doc warning callout block" iw
|
||||||
\begin{-doc-warning}
|
\begin{-doc-warning}
|
||||||
$1
|
$1
|
||||||
\end{-doc-warning}
|
\end{-doc-warning}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet dcrit "Doc critical callout block" iw
|
snippet dcrit "Doc critical callout block" iw
|
||||||
\begin{-doc-critical}
|
\begin{-doc-critical}
|
||||||
$1
|
$1
|
||||||
\end{-doc-critical}
|
\end{-doc-critical}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet dlist "Doc listings callout block" iw
|
snippet dlist "Doc listings callout block" iw
|
||||||
\begin{-doc-listing}{${1:<title>}}{${2:<label name>}}{${3:<language>}}
|
\begin{-doc-listing}{${1:<title>}}{${2:<label name>}}{${3:<language>}}
|
||||||
$4
|
$4
|
||||||
\end{-doc-listing}
|
\end{-doc-listing}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user