Neovim configs for 2023. Hopefully they last.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

446 lines
9.9 KiB

3 months ago
  1. #version 1
  2. #PREAMBLE
  3. #documentclass without options
  4. snippet dcl \documentclass{}
  5. \\documentclass{${1:class}} ${0}
  6. #documentclass with options
  7. snippet dclo \documentclass[]{}
  8. \\documentclass[${1:options}]{${2:class}} ${0}
  9. snippet tmplt "Template"
  10. \\documentclass{${1:article}}
  11. \\usepackage{import}
  12. \\usepackage{pdfpages}
  13. \\usepackage{transparent}
  14. \\usepackage{xcolor}
  15. $2
  16. \\newcommand{\incfig}[2][1]{%
  17. \def\svgwidth{#1\columnwidth}
  18. \import{./figures/}{#2.pdf_tex}
  19. }
  20. $3
  21. \\pdfsuppresswarningpagegroup=1
  22. \\begin{document}
  23. $0
  24. \\end{document}
  25. #newcommand
  26. snippet nc \newcommand
  27. \\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
  28. #usepackage
  29. snippet up \usepackage
  30. \\usepackage[${1:options}]{${2:package}} ${0}
  31. #newunicodechar
  32. snippet nuc \newunicodechar
  33. \\newunicodechar{${1}}{${2:\\ensuremath}${3:tex-substitute}}} ${0}
  34. #DeclareMathOperator
  35. snippet dmo \DeclareMathOperator
  36. \\DeclareMathOperator{${1}}{${2}} ${0}
  37. #DOCUMENT
  38. # \begin{}...\end{}
  39. snippet begin \begin{} ... \end{} block
  40. \\begin{${1:env}}
  41. ${0:${VISUAL}}
  42. \\end{$1}
  43. # Maketitle
  44. snippet mkt maketitle
  45. \\maketitle
  46. # Tabular
  47. snippet tab tabular (or arbitrary) environment
  48. \\begin{${1:tabular}}{${2:c}}
  49. ${0:${VISUAL}}
  50. \\end{$1}
  51. snippet thm thm (or arbitrary) environment with optional argument
  52. \\begin[${1:author}]{${2:thm}}
  53. ${0:${VISUAL}}
  54. \\end{$2}
  55. snippet center center environment
  56. \\begin{center}
  57. ${0:${VISUAL}}
  58. \\end{center}
  59. # Align(ed)
  60. snippet ali align(ed) environment
  61. \\begin{align*}
  62. ${0:${VISUAL}}
  63. \\end{align*}
  64. # Gather(ed)
  65. snippet gat gather(ed) environment
  66. \\begin{gather${1:ed}}
  67. ${0:${VISUAL}}
  68. \\end{gather$1}
  69. # Equation
  70. snippet eq equation environment
  71. \\begin{equation}
  72. ${0:${VISUAL}}
  73. \\end{equation}
  74. # Equation
  75. snippet eql Labeled equation environment
  76. \\begin{equation}
  77. \\label{eq:${2}}
  78. ${0:${VISUAL}}
  79. \\end{equation}
  80. # Equation
  81. snippet eq* unnumbered equation environment
  82. \\begin{equation*}
  83. ${0:${VISUAL}}
  84. \\end{equation*}
  85. # Unnumbered Equation
  86. snippet \ unnumbered equation: \[ ... \]
  87. \\[
  88. ${0:${VISUAL}}
  89. \\]
  90. # Equation array
  91. snippet eqnarray eqnarray environment
  92. \\begin{eqnarray}
  93. ${0:${VISUAL}}
  94. \\end{eqnarray}
  95. # Label
  96. snippet lab \label
  97. \\label{${1:eq:}${2:fig:}${3:tab:}${0}}
  98. # Enumerate
  99. snippet enum enumerate environment
  100. \\begin{enumerate}
  101. \\item ${0}
  102. \\end{enumerate}
  103. snippet enuma enumerate environment
  104. \\begin{enumerate}[(a)]
  105. \\item ${0}
  106. \\end{enumerate}
  107. snippet enumi enumerate environment
  108. \\begin{enumerate}[(i)]
  109. \\item ${0}
  110. \\end{enumerate}
  111. # Itemize
  112. snippet item itemize environment
  113. \\begin{itemize}
  114. \\item ${0}
  115. \\end{itemize}
  116. snippet it \item
  117. \\item ${1:${VISUAL}}
  118. # Description
  119. snippet desc description environment
  120. \\begin{description}
  121. \\item[${1}] ${0}
  122. \\end{description}
  123. # Endless new item
  124. snippet ]i \item (recursive)
  125. \\item ${1}
  126. ${0:]i}
  127. # Matrix
  128. snippet mat smart matrix environment
  129. \\begin{${1:p/b/v/V/B/small}matrix}
  130. ${0:${VISUAL}}
  131. \\end{$1matrix}
  132. # Cases
  133. snippet cas cases environment
  134. \\begin{cases}
  135. ${1:equation}, &\\text{ if }${2:case}\\
  136. ${0:${VISUAL}}
  137. \\end{cases}
  138. # Split
  139. snippet spl split environment
  140. \\begin{split}
  141. ${0:${VISUAL}}
  142. \\end{split}
  143. # Part
  144. snippet part document \part
  145. \\part{${1:part name}} % (fold)%
  146. \\label{prt:${2:$1}}
  147. ${0}
  148. % part $2 (end)
  149. # Chapter
  150. snippet cha \chapter
  151. \\chapter{${1:chapter name}}%
  152. \\label{cha:${2:$1}}
  153. ${0}
  154. # Section
  155. snippet sec \section
  156. \\section{${1:section name}}%
  157. \\label{sec:${2:$1}}
  158. ${0}
  159. # Section without number
  160. snippet sec* \section*
  161. \\section*{${1:section name}}%
  162. \\label{sec:${2:$1}}
  163. ${0}
  164. # Sub Section
  165. snippet sub \subsection
  166. \\subsection{${1:subsection name}}%
  167. \\label{sub:${2:$1}}
  168. ${0}
  169. # Sub Section without number
  170. snippet sub* \subsection*
  171. \\subsection*{${1:subsection name}}%
  172. \\label{sub:${2:$1}}
  173. ${0}
  174. # Sub Sub Section
  175. snippet ssub \subsubsection
  176. \\subsubsection{${1:subsubsection name}}%
  177. \\label{ssub:${2:$1}}
  178. ${0}
  179. # Sub Sub Section without number
  180. snippet ssub* \subsubsection*
  181. \\subsubsection*{${1:subsubsection name}}%
  182. \\label{ssub:${2:$1}}
  183. ${0}
  184. # Paragraph
  185. snippet par \paragraph
  186. \\paragraph{${1:paragraph name}}%
  187. \\label{par:${2:$1}}
  188. ${0}
  189. # Paragraph*
  190. snippet par* \paragraph*
  191. \\paragraph*{${1:paragraph name}}%
  192. \\label{par:${2:$1}}
  193. ${0}
  194. # Sub Paragraph
  195. snippet subp \subparagraph
  196. \\subparagraph{${1:subparagraph name}}%
  197. \\label{subp:${2:$1}}
  198. ${0}
  199. # Sub Paragraph*
  200. snippet subp* \subparagraph*
  201. \\subparagraph*{${1:subparagraph name}}%
  202. \\label{subp:${2:$1}}
  203. ${0}
  204. snippet ni \noindent
  205. \\noindent
  206. ${0}
  207. #References
  208. snippet itd description \item
  209. \\item[${1:description}] ${0:item}
  210. snippet figure reference to a figure
  211. ${1:Figure}~\\ref{${2:fig:}}
  212. snippet table reference to a table
  213. ${1:Table}~\\ref{${2:tab:}}
  214. snippet listing reference to a listing
  215. ${1:Listing}~\\ref{${2:list}}
  216. snippet section reference to a section
  217. ${1:Section}~\\ref{sec:${2}} ${0}
  218. snippet page reference to a page
  219. ${1:page}~\\pageref{${2}} ${0}
  220. snippet index \index
  221. \\index{${1:index}} ${0}
  222. #Citations
  223. snippet citen \citen
  224. \\citen{${1}} ${0}
  225. # natbib citations
  226. snippet citep \citep
  227. \\citep{${1}} ${0}
  228. snippet citet \citet
  229. \\citet{${1}} ${0}
  230. snippet cite \cite[]{}
  231. \\cite[${1}]{${2}} ${0}
  232. snippet citea \citeauthor
  233. \\citeauthor{${1}} ${0}
  234. snippet citey \citeyear
  235. \\citeyear{${1}} ${0}
  236. snippet fcite \footcite[]{}
  237. \\footcite[${1}]{${2}}${0}
  238. #Formating text: italic, bold, underline, small capital, emphase ..
  239. snippet ita italic text
  240. \\textit{${1:${VISUAL:text}}}${0}
  241. snippet bf bold face text
  242. \\textbf{${1:${VISUAL:text}}}${0}
  243. snippet under underline text
  244. \\underline{${1:${VISUAL:text}}}${0}
  245. snippet over overline text
  246. \\overline{${1:${VISUAL:text}}}${0}
  247. snippet emp emphasize text
  248. \\emph{${1:${VISUAL:text}}}${0}
  249. snippet sc small caps text
  250. \\textsc{${1:${VISUAL:text}}}${0}
  251. #Choosing font
  252. snippet sf sans serife text
  253. \\textsf{${1:${VISUAL:text}}}${0}
  254. snippet rm roman font text
  255. \\textrm{${1:${VISUAL:text}}}${0}
  256. snippet tt typewriter (monospace) text
  257. \\texttt{${1:${VISUAL:text}}}${0}
  258. snippet tsub subscripted text
  259. \\textsubscript{${1:${VISUAL:text}}}${0}
  260. snippet tsup superscripted text
  261. \\textsuperscript{${1:${VISUAL:text}}}${0}
  262. #Math font
  263. snippet mf mathfrak
  264. \\mathfrak{${1:${VISUAL:text}}}${0}
  265. snippet mc mathcal
  266. \\mathcal{${1:${VISUAL:text}}}${0}
  267. snippet ms mathscr
  268. \\mathscr{${1:${VISUAL:text}}}${0}
  269. #misc
  270. snippet ft \footnote
  271. \\footnote{${1:${VISUAL:text}}}${0}
  272. snippet fig figure environment (includegraphics)
  273. \\begin{figure}
  274. \\begin{center}
  275. \\includegraphics[scale=${1}]{Figures/${2}}
  276. \\end{center}
  277. \\caption{${3}}
  278. \\label{fig:${4}}
  279. \\end{figure}
  280. ${0}
  281. snippet tikz figure environment (tikzpicture)
  282. \\begin{figure}[htpb]
  283. \\begin{center}
  284. \\begin{tikzpicture}[scale=${1:1}, transform shape]
  285. ${2}
  286. \\end{tikzpicture}
  287. \\end{center}
  288. \\caption{${3}}%
  289. \\label{fig:${4}}
  290. \\end{figure}
  291. ${0}
  292. snippet subfig subfigure environment
  293. \\begin{subfigure}[${1}]{${2:\\textwidth}}
  294. \\begin{center}
  295. ${3}
  296. \\end{center}
  297. \\caption{${4}}
  298. \\label{fig:${5}}
  299. \\end{subfigure}
  300. ${0}
  301. snippet tikzcd tikzcd environment in equation
  302. \\begin{equation}
  303. \\begin{tikzcd}
  304. ${1}
  305. \\end{tikzcd}
  306. \\end{equation}
  307. ${0}
  308. snippet tikzcd* tikzcd environment in equation*
  309. \\begin{equation*}
  310. \\begin{tikzcd}
  311. ${1}
  312. \\end{tikzcd}
  313. \\end{equation*}
  314. ${0}
  315. #math
  316. snippet stackrel \stackrel{}{}
  317. \\stackrel{${1:above}}{${2:below}} ${0}
  318. snippet frac \frac{}{}
  319. \\frac{${1:num}}{${2:denom}} ${0}
  320. snippet sum \sum^{}_{}
  321. \\sum^{${1:n}}_{${2:i=1}} ${0}
  322. snippet lim \lim_{}
  323. \\lim_{${1:n \\to \\infty}} ${0}
  324. snippet frame frame environment
  325. \\begin{frame}[${1:t}]
  326. \frametitle{${2:title}}
  327. \framesubtitle{${3:subtitle}}
  328. ${0:${VISUAL}}
  329. \\end{frame}
  330. snippet block block environment
  331. \\begin{block}{${1:title}}
  332. ${0:${VISUAL}}
  333. \\end{block}
  334. snippet alert alert text
  335. \\alert{${1:${VISUAL:text}}} ${0}
  336. snippet alertblock alertblock environment
  337. \\begin{alertblock}{${1:title}}
  338. ${0:${VISUAL}}
  339. \\end{alertblock}
  340. snippet example exampleblock environment
  341. \\begin{exampleblock}{${1:title}}
  342. ${0:${VISUAL}}
  343. \\end{exampleblock}
  344. snippet col2 two-column environment
  345. \\begin{columns}
  346. \\begin{column}{0.5\\textwidth}
  347. ${1}
  348. \\end{column}
  349. \\begin{column}{0.5\\textwidth}
  350. ${0}
  351. \\end{column}
  352. \\end{columns}
  353. snippet multicol2 two-column environment with multicol
  354. \\begin{multicols}{2}
  355. ${1}
  356. \columnbreak
  357. ${0}
  358. \\end{multicols}
  359. snippet \{ \{ \}
  360. \\{ ${0} \\}
  361. #delimiter
  362. snippet lr left right
  363. \\left${1} ${0:${VISUAL}} \\right$1
  364. snippet lr( left( right)
  365. \\left( ${0:${VISUAL}} \\right)
  366. snippet lr| left| right|
  367. \\left| ${0:${VISUAL}} \\right|
  368. snippet lr{ left\{ right\}
  369. \\left\\{ ${0:${VISUAL}} \\right\\}
  370. snippet lr[ left[ right]
  371. \\left[ ${0:${VISUAL}} \\right]
  372. snippet lra langle rangle
  373. \\langle ${0:${VISUAL}} \\rangle
  374. # Code listings
  375. snippet lst
  376. \\begin{listing}[language=${1:language}]
  377. ${0:${VISUAL}}
  378. \\end{listing}
  379. snippet lsi
  380. \\lstinline|${1}| ${0}
  381. # Hyperlinks
  382. snippet url
  383. \\url{${1}} ${0}
  384. snippet href
  385. \\href{${1}}{${2}} ${0}
  386. # URL from Clipboard.
  387. snippet urlc
  388. \\url{`@+`} ${0}
  389. snippet hrefc
  390. \\href{`@+`}{${1}} ${0}
  391. # enquote from package csquotes
  392. snippet enq enquote
  393. \\enquote{${1:${VISUAL:text}}} ${0}
  394. # Time derivative
  395. snippet ddt time derivative
  396. \\frac{d}{dt} {$1} {$0}
  397. # Limit
  398. snippet lim limit
  399. \\lim_{{$1}} {{$2}} {$0}
  400. # Partial derivative
  401. snippet pdv partial derivation
  402. \\frac{\\partial {$1}}{\\partial {$2}} {$0}
  403. # Second order partial derivative
  404. snippet ppdv second partial derivation
  405. \\frac{\\partial^2 {$1}}{\\partial {$2} \\partial {$3}} {$0}
  406. # Ordinary derivative
  407. snippet dv derivative
  408. \\frac{d {$1}}{d {$2}} {$0}
  409. # Summation
  410. snippet summ summation
  411. \\sum_{{$1}} {$0}
  412. # Shorthand for time derivative
  413. snippet dot dot
  414. \\dot{{$1}} {$0}
  415. # Shorthand for second order time derivative
  416. snippet ddot ddot
  417. \\ddot{{$1}} {$0}
  418. # Vector
  419. snippet vec vector
  420. \\vec{{$1}} {$0}
  421. # Bar
  422. snippet bar bar
  423. \\bar{{$1}} {$0}
  424. # Cross product
  425. snippet \x cross product
  426. \\times {$0}
  427. # Dot product
  428. snippet . dot product
  429. \\cdot {$0}
  430. # Integral
  431. snippet int integral
  432. \\int_{{$1}}^{{$2}} {$3} \\: d{$4} {$0}
  433. # Right arrow
  434. snippet ra rightarrow
  435. \\rightarrow {$0}
  436. # Long right arrow
  437. snippet lra longrightarrow
  438. \\longrightarrow {$0}