diff options
author | Yigit Sever | 2023-08-18 23:42:39 +0300 |
---|---|---|
committer | Yigit Sever | 2023-08-18 23:42:39 +0300 |
commit | 387e08c52d9752bc839c71119f140ba8435c3d70 (patch) | |
tree | 3bb20c0e58ccf1e65ced4cfdfb6459e226a24672 /.config/nvim/my_snippets/tex.snippets | |
parent | 14c14cfcc9aeb4bada6d2429162ded2917f26a94 (diff) | |
download | dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.tar.gz dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.tar.bz2 dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.zip |
nvim: switch to lazy.nvim
revert this as whole, if you miss the good old days
Diffstat (limited to '.config/nvim/my_snippets/tex.snippets')
-rw-r--r-- | .config/nvim/my_snippets/tex.snippets | 172 |
1 files changed, 0 insertions, 172 deletions
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 @@ | |||
1 | # vim:ft=snippets: | ||
2 | # https://castel.dev/post/lecture-notes-1/ | ||
3 | |||
4 | global !p | ||
5 | def math(): | ||
6 | return vim.eval('vimtex#syntax#in_mathzone()') == '1' | ||
7 | endglobal | ||
8 | |||
9 | snippet template "Basic template" b | ||
10 | \documentclass[a4paper]{article} | ||
11 | |||
12 | \usepackage[utf8]{inputenc} | ||
13 | \usepackage[T1]{fontenc} | ||
14 | \usepackage{textcomp} | ||
15 | \usepackage{babel} | ||
16 | \usepackage{amsmath, amssymb} | ||
17 | |||
18 | % figure support | ||
19 | \usepackage{import} | ||
20 | \usepackage{xifthen} | ||
21 | \pdfminorversion=7 | ||
22 | \usepackage{pdfpages} | ||
23 | \usepackage{transparent} | ||
24 | |||
25 | \begin{document} | ||
26 | $0 | ||
27 | \end{document} | ||
28 | endsnippet | ||
29 | |||
30 | snippet beg "begin{} / end{}" bA | ||
31 | \\begin{$1} | ||
32 | $0 | ||
33 | \\end{$1} | ||
34 | endsnippet | ||
35 | |||
36 | priority 100 | ||
37 | snippet ... "ldots" iA | ||
38 | \ldots | ||
39 | endsnippet | ||
40 | |||
41 | snippet table "Table environment" b | ||
42 | \begin{table}[${1:htpb}] | ||
43 | \centering | ||
44 | \caption{${2:caption}}% | ||
45 | \label{tab:${3:label}} | ||
46 | \begin{tabular}{${5:c}} | ||
47 | $0${5/((?<=.)c|l|r)|./(?1: & )/g} | ||
48 | \end{tabular} | ||
49 | \end{table} | ||
50 | endsnippet | ||
51 | |||
52 | snippet fig "Figure environment" b | ||
53 | \begin{figure}[${1:htpb}] | ||
54 | \centering | ||
55 | ${2:\includegraphics[width=0.8\textwidth]{$3}} | ||
56 | \caption{${4:$3}}% | ||
57 | \label{fig:${5:${3/\W+/-/g}}} | ||
58 | \end{figure} | ||
59 | endsnippet | ||
60 | |||
61 | snippet enum "Enumerate" bA | ||
62 | \begin{enumerate} | ||
63 | \item $0 | ||
64 | \end{enumerate} | ||
65 | endsnippet | ||
66 | |||
67 | snippet item "Itemize" bA | ||
68 | \begin{itemize} | ||
69 | \item $0 | ||
70 | \end{itemize} | ||
71 | endsnippet | ||
72 | |||
73 | snippet desc "Description" b | ||
74 | \begin{description} | ||
75 | \item[$1] $0 | ||
76 | \end{description} | ||
77 | endsnippet | ||
78 | |||
79 | snippet on "O(n)" b | ||
80 | \mathcal{O}(n) | ||
81 | endsnippet | ||
82 | |||
83 | snippet mk "Math" wA | ||
84 | $${1}$`!p | ||
85 | if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: | ||
86 | snip.rv = ' ' | ||
87 | else: | ||
88 | snip.rv = '' | ||
89 | `$2 | ||
90 | endsnippet | ||
91 | |||
92 | snippet dm "Math" wA | ||
93 | \[ | ||
94 | ${1:${VISUAL}} | ||
95 | .\] $0 | ||
96 | endsnippet | ||
97 | |||
98 | context "math()" | ||
99 | snippet '([A-Za-z])(\d)' "auto subscript" wrA | ||
100 | `!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)` | ||
101 | endsnippet | ||
102 | |||
103 | context "math()" | ||
104 | snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA | ||
105 | `!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`} | ||
106 | endsnippet | ||
107 | |||
108 | context "math()" | ||
109 | snippet // "Fraction" iA | ||
110 | \\frac{$1}{$2}$0 | ||
111 | endsnippet | ||
112 | |||
113 | context "math()" | ||
114 | snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA | ||
115 | \\frac{`!p snip.rv = match.group(1)`}{$1}$0 | ||
116 | endsnippet | ||
117 | |||
118 | snippet sec "Section" | ||
119 | \section{${1:${VISUAL:section name}}}% | ||
120 | \label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
121 | |||
122 | $0 | ||
123 | endsnippet | ||
124 | |||
125 | snippet sec* "Section" | ||
126 | \section*{${1:${VISUAL:section name}}}% | ||
127 | \label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
128 | |||
129 | ${0} | ||
130 | endsnippet | ||
131 | |||
132 | |||
133 | snippet sub "Subsection" | ||
134 | \subsection{${1:${VISUAL:subsection name}}}% | ||
135 | \label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
136 | |||
137 | $0 | ||
138 | endsnippet | ||
139 | |||
140 | snippet sub* "Subsection" | ||
141 | \subsection*{${1:${VISUAL:subsection name}}}% | ||
142 | \label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
143 | |||
144 | ${0} | ||
145 | endsnippet | ||
146 | |||
147 | snippet ssub "Subsubsection" | ||
148 | \subsubsection{${1:${VISUAL:subsubsection name}}}% | ||
149 | \label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
150 | |||
151 | $0 | ||
152 | endsnippet | ||
153 | |||
154 | snippet ssub* "Subsubsection" | ||
155 | \subsubsection*{${1:${VISUAL:subsubsection name}}}% | ||
156 | \label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
157 | |||
158 | ${0} | ||
159 | endsnippet | ||
160 | |||
161 | snippet "mint(ed)?( (\S+))?" "Minted code typeset" br | ||
162 | \begin{listing} | ||
163 | \begin{minted}[linenos,numbersep=5pt,frame=lines,framesep=2mm]{${1:`!p | ||
164 | snip.rv = match.group(3) if match.group(2) is not None else "language"`}} | ||
165 | ${2:${VISUAL:code}} | ||
166 | \end{minted} | ||
167 | \caption{${3:caption name}} | ||
168 | \label{lst:${4:${3/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} | ||
169 | \end{listing} | ||
170 | |||
171 | $0 | ||
172 | endsnippet | ||