amsthm.snippets (1013B)
1 priority 1 2 3 global !p 4 def math(): 5 return vim.eval('vimtex#syntax#in_mathzone()') == '1' 6 def comment(): 7 return vim.eval('vimtex#syntax#in_comment()') == '1' 8 def env(name): 9 x, y = vim.eval("vimtex#env#is_inside('" + name + "')") 10 return x != '0' and y != '0' 11 endglobal 12 13 14 context "not math()" 15 16 snippet amsthm "amsthm" b 17 \usepackage{amsthm} 18 \newtheorem{theorem}{Theorem} 19 \newtheorem{proposition}{Proposition} 20 \newtheorem{lemma}{Lemma} 21 \newtheorem{corollary}{Corollary} 22 \newtheorem{affirmation}{Affirmation} 23 \newtheorem{exercise}{Exercise} 24 \newtheorem{problem}{Problem} 25 \theoremstyle{definition} 26 \newtheorem{definition}{Definition} 27 \theoremstyle{remark} 28 \newtheorem{example}{Example} 29 \newtheorem{observation}{Observation} 30 \newtheorem{remark}{Remark} 31 32 endsnippet 33 34 # --------------------------------------------- # 35 36 context "not math()" 37 snippet def "begin{definition}" b 38 \begin{definition}[${1}] 39 $2 `!p snip.rv = " ".join(f'\\emph{{{s.strip().lower()}}}' for s in t[1].split(','))` $3 40 \end{definition} 41 $0 42 endsnippet