Initial commit
This commit is contained in:
158
nvim/UltiSnips/tex.snippets
Normal file
158
nvim/UltiSnips/tex.snippets
Normal file
@ -0,0 +1,158 @@
|
||||
priority -50
|
||||
|
||||
extends texmath
|
||||
|
||||
snippet document "document setup"
|
||||
\documentclass[a4paper]{article}
|
||||
\usepackage{defaultTex}
|
||||
% \usepackage[style=alphabetic]{biblatex}
|
||||
% \addbibresource{lib.bib}
|
||||
|
||||
\begin{document}
|
||||
${1:text}
|
||||
\end{document}
|
||||
endsnippet
|
||||
|
||||
snippet "b(egin)?" "begin{} / end{}" br
|
||||
\begin{${1:something}}
|
||||
${0:${VISUAL}}
|
||||
\label{${2}}
|
||||
\end{$1}
|
||||
endsnippet
|
||||
|
||||
snippet bo "bold"
|
||||
\textbf{${1:${VISUAL}}}$0
|
||||
endsnippet
|
||||
|
||||
snippet tab
|
||||
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
|
||||
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
|
||||
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
|
||||
endsnippet
|
||||
|
||||
snippet fig "Figure environment" b
|
||||
\begin{figure}${2:[htpb]}
|
||||
\centering
|
||||
\includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
|
||||
\caption{${4/(\w+)\.\w+/\u$1/}$0}
|
||||
\label{fig:${4/(\w+)\.\w+/$1/}}
|
||||
\end{figure}
|
||||
endsnippet
|
||||
|
||||
snippet enum "Enumerate" b
|
||||
\begin{enumerate}
|
||||
\item $1
|
||||
\end{enumerate}
|
||||
endsnippet
|
||||
|
||||
snippet item "Itemize" b
|
||||
\begin{itemize}
|
||||
\item $1
|
||||
\end{itemize}
|
||||
endsnippet
|
||||
|
||||
snippet desc "Description" b
|
||||
\begin{description}
|
||||
\item[$1] $0
|
||||
\end{description}
|
||||
endsnippet
|
||||
|
||||
snippet eq "equation"
|
||||
\begin{equation}
|
||||
${2:${VISUAL}}
|
||||
\end{equation}
|
||||
endsnippet
|
||||
|
||||
snippet eql "equation with label"
|
||||
\begin{equation}
|
||||
${2:${VISUAL}}
|
||||
\label{$1}
|
||||
\end{equation}
|
||||
endsnippet
|
||||
|
||||
snippet eqs "aligned equations"
|
||||
\begin{equation}
|
||||
\begin{aligned}
|
||||
${2:${VISUAL}}
|
||||
\end{aligned}
|
||||
\end{equation}
|
||||
endsnippet
|
||||
|
||||
snippet eqsl "aligned equations with label"
|
||||
\begin{equation}
|
||||
\begin{aligned}
|
||||
${2:${VISUAL}}
|
||||
\end{aligned}
|
||||
\label{$1}
|
||||
\end{equation}
|
||||
endsnippet
|
||||
|
||||
snippet align "align"
|
||||
\begin{align}
|
||||
${2:${VISUAL}}
|
||||
\label{$1}
|
||||
\end{align}
|
||||
endsnippet
|
||||
|
||||
snippet it "Individual item" b
|
||||
\item $1
|
||||
endsnippet
|
||||
|
||||
snippet part "Part" b
|
||||
\part{${1:part name}}
|
||||
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet cha "Chapter" b
|
||||
\chapter{${1:chapter name}}
|
||||
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet sec "Section" b
|
||||
\section{${1:section name}}
|
||||
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet sub "Subsection" b
|
||||
\subsection{${1:subsection name}}
|
||||
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet ssub "Subsubsection" b
|
||||
\subsubsection{${1:subsubsection name}}
|
||||
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet par "Paragraph" b
|
||||
\paragraph{${1:paragraph name}}
|
||||
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet subp "Subparagraph" b
|
||||
\subparagraph{${1:subparagraph name}}
|
||||
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet ni "Non-indented paragraph" b
|
||||
\noindent
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet pac "Package" b
|
||||
\usepackage[${1:options}]{${2:package}}$0
|
||||
endsnippet
|
||||
# vim:ft=snippets:
|
||||
Reference in New Issue
Block a user