From 387e08c52d9752bc839c71119f140ba8435c3d70 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 18 Aug 2023 23:42:39 +0300 Subject: nvim: switch to lazy.nvim revert this as whole, if you miss the good old days --- .config/nvim/my_snippets/tex.snippets | 172 ---------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 .config/nvim/my_snippets/tex.snippets (limited to '.config/nvim/my_snippets/tex.snippets') diff --git a/.config/nvim/my_snippets/tex.snippets b/.config/nvim/my_snippets/tex.snippets deleted file mode 100644 index 727253f..0000000 --- a/.config/nvim/my_snippets/tex.snippets +++ /dev/null @@ -1,172 +0,0 @@ -# vim:ft=snippets: -# https://castel.dev/post/lecture-notes-1/ - -global !p -def math(): - return vim.eval('vimtex#syntax#in_mathzone()') == '1' -endglobal - -snippet template "Basic template" b -\documentclass[a4paper]{article} - -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage{textcomp} -\usepackage{babel} -\usepackage{amsmath, amssymb} - -% figure support -\usepackage{import} -\usepackage{xifthen} -\pdfminorversion=7 -\usepackage{pdfpages} -\usepackage{transparent} - -\begin{document} - $0 -\end{document} -endsnippet - -snippet beg "begin{} / end{}" bA -\\begin{$1} - $0 -\\end{$1} -endsnippet - -priority 100 -snippet ... "ldots" iA -\ldots -endsnippet - -snippet table "Table environment" b -\begin{table}[${1:htpb}] - \centering - \caption{${2:caption}}% - \label{tab:${3:label}} - \begin{tabular}{${5:c}} - $0${5/((?<=.)c|l|r)|./(?1: & )/g} - \end{tabular} -\end{table} -endsnippet - -snippet fig "Figure environment" b -\begin{figure}[${1:htpb}] - \centering - ${2:\includegraphics[width=0.8\textwidth]{$3}} - \caption{${4:$3}}% - \label{fig:${5:${3/\W+/-/g}}} -\end{figure} -endsnippet - -snippet enum "Enumerate" bA -\begin{enumerate} - \item $0 -\end{enumerate} -endsnippet - -snippet item "Itemize" bA -\begin{itemize} - \item $0 -\end{itemize} -endsnippet - -snippet desc "Description" b -\begin{description} - \item[$1] $0 -\end{description} -endsnippet - -snippet on "O(n)" b -\mathcal{O}(n) -endsnippet - -snippet mk "Math" wA -$${1}$`!p -if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: - snip.rv = ' ' -else: - snip.rv = '' -`$2 -endsnippet - -snippet dm "Math" wA -\[ -${1:${VISUAL}} -.\] $0 -endsnippet - -context "math()" -snippet '([A-Za-z])(\d)' "auto subscript" wrA -`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)` -endsnippet - -context "math()" -snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA -`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`} -endsnippet - -context "math()" -snippet // "Fraction" iA -\\frac{$1}{$2}$0 -endsnippet - -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