dotfiles/nvim/ultisnips/tex.snippets
2022-11-09 19:09:19 -05:00

30 lines
367 B
Plaintext

global !p
def math():
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
endglobal
snippet beg "begin{} / end{}" bA
\\begin{$1}
$2
\\end{$1}$0
endsnippet
snippet sm "Math" wA
$${1}$`!p
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
snip.rv = ' '
else:
snip.rv = ''
`$2
endsnippet
snippet dm "Display Math" wA
\[
$1
.\] $0
endsnippet