commit 0923aa96ce0d8e0d15088c4a3fa1b55c1ecb4836
parent 5d5fd75253dcce27893c344dc7607532920a115c
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date: Wed, 22 Feb 2023 20:58:42 -0500
Update tex snippets
Diffstat:
1 file changed, 46 insertions(+), 20 deletions(-)
diff --git a/UltiSnips/tex.snippets b/UltiSnips/tex.snippets
@@ -1,3 +1,5 @@
+priority 1
+
global !p
def math():
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
@@ -73,24 +75,6 @@ snippet pac "Package" b
\usepackage${1/(.+)/(?1:[)/}${1:option}${1/(.+)/(?1:])/}{${2:package}}$0
endsnippet
-snippet => "implies" Ai
-\implies $0
-endsnippet
-
-snippet =< "implied by" Ai
-\impliedby $0
-endsnippet
-
-context "math()"
-snippet iff "iff" Ai
-\iff $0
-endsnippet
-
-context "math()"
-snippet thr4 "\therefore" wiA
-\therefore $0
-endsnippet
-
context "not math()"
snippet mk "Math" wA
\($1\)$0
@@ -550,7 +534,6 @@ endsnippet
# --------------------------------------------- #
-priority -100
context "math()"
snippet '([A-Za-z]|\\math[^{]*{[A-Za-z]})(\d)' "auto subscript" wrA
`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
@@ -631,6 +614,49 @@ $\mu$-ctp$0
endsnippet
context "not math()"
-snippet contra "(=><=)"
+snippet => "(=>)" iA
+($\Rightarrow$)
+endsnippet
+
+context "not math()"
+snippet =< "(=<)" iA
+($\Leftarrow$)
+endsnippet
+
+context "not math()"
+snippet =>< "(=><=)" iA
($\Rightarrow\!\Leftarrow$)
endsnippet
+
+context "math()"
+snippet => "\Rightarrow" Ai
+\Rightarrow $0
+endsnippet
+
+context "math()"
+snippet =< "\Leftarrow" Ai
+\Leftarrow $0
+endsnippet
+
+context "math()"
+snippet iff "iff" Ai
+\iff $0
+endsnippet
+
+context "math()"
+snippet thr4 "\therefore" wiA
+\therefore $0
+endsnippet
+
+priority 2
+context "math()"
+snippet ==> "implies" Ai
+\implies $0
+endsnippet
+
+context "math()"
+snippet ==< "implied by" Ai
+\impliedby $0
+endsnippet
+
+priority 1