From 766260cbebe7cf92316b5ac85de5e4f1fe2c1701 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sat, 4 Jun 2022 15:33:33 +0300 Subject: nvim: reclaim lost tex snippets --- .config/nvim/my_snippets/tex.snippets | 62 +++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/.config/nvim/my_snippets/tex.snippets b/.config/nvim/my_snippets/tex.snippets index f81ad94..727253f 100644 --- a/.config/nvim/my_snippets/tex.snippets +++ b/.config/nvim/my_snippets/tex.snippets @@ -21,12 +21,6 @@ snippet template "Basic template" b \pdfminorversion=7 \usepackage{pdfpages} \usepackage{transparent} -\newcommand{\incfig}[1]{% - \def\svgwidth{\columnwidth} - \import{./figures/}{#1.pdf_tex} -} - -\pdfsuppresswarningpagegroup=1 \begin{document} $0 @@ -120,3 +114,59 @@ context "math()" snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA \\frac{`!p snip.rv = match.group(1)`}{$1}$0 endsnippet + +snippet sec "Section" +\section{${1:${VISUAL:section name}}}% +\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} + +$0 +endsnippet + +snippet sec* "Section" +\section*{${1:${VISUAL:section name}}}% +\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} + +${0} +endsnippet + + +snippet sub "Subsection" +\subsection{${1:${VISUAL:subsection name}}}% +\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} + +$0 +endsnippet + +snippet sub* "Subsection" +\subsection*{${1:${VISUAL:subsection name}}}% +\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} + +${0} +endsnippet + +snippet ssub "Subsubsection" +\subsubsection{${1:${VISUAL:subsubsection name}}}% +\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} + +$0 +endsnippet + +snippet ssub* "Subsubsection" +\subsubsection*{${1:${VISUAL:subsubsection name}}}% +\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} + +${0} +endsnippet + +snippet "mint(ed)?( (\S+))?" "Minted code typeset" br +\begin{listing} +\begin{minted}[linenos,numbersep=5pt,frame=lines,framesep=2mm]{${1:`!p +snip.rv = match.group(3) if match.group(2) is not None else "language"`}} +${2:${VISUAL:code}} +\end{minted} +\caption{${3:caption name}} +\label{lst:${4:${3/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} +\end{listing} + +$0 +endsnippet -- cgit v1.2.3-70-g09d2