From bdb1444d0143b467b309584fc72eb2a538909111 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Fri, 19 May 2023 19:35:07 +0200 Subject: [PATCH] Add math mode snippets --- .vim/snips/pandoc.snippets | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.vim/snips/pandoc.snippets b/.vim/snips/pandoc.snippets index 1808a04..e57c6e0 100644 --- a/.vim/snips/pandoc.snippets +++ b/.vim/snips/pandoc.snippets @@ -251,15 +251,16 @@ $1 \end{bmatrix} endsnippet -snippet $ -$$1$$2 +# Insert anything after m/M in math mode + +snippet "(\b)m(.*)" "MathJax" r +`!p snip.rv = match.group(1) + "$" + match.group(2) + "$"` endsnippet -snippet $$ +snippet (\b)M(.*) "MathJax block" irw $$ -$1 +`!p snip.rv = match.group(2)` $$ -$2 endsnippet # MathJax