2022-05-11 12:08:01 +02:00
|
|
|
# A valid snippet should starts with:
|
|
|
|
#
|
|
|
|
# snippet trigger_word [ "description" [ options ] ]
|
|
|
|
#
|
|
|
|
# and end with:
|
|
|
|
#
|
|
|
|
# endsnippet
|
|
|
|
#
|
|
|
|
# Snippet options:
|
|
|
|
#
|
|
|
|
# b - Beginning of line.
|
|
|
|
# i - In-word expansion.
|
|
|
|
# w - Word boundary.
|
|
|
|
# r - Regular expression
|
|
|
|
# e - Custom context snippet
|
|
|
|
# A - Snippet will be triggered automatically, when condition matches.
|
|
|
|
#
|
|
|
|
# Basic example:
|
|
|
|
#
|
|
|
|
# snippet emitter "emitter properties" b
|
|
|
|
# private readonly ${1} = new Emitter<$2>()
|
|
|
|
# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event
|
|
|
|
# endsnippet
|
|
|
|
#
|
|
|
|
# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
|
|
|
|
|
2023-05-15 13:41:06 +02:00
|
|
|
global !p
|
|
|
|
def math():
|
|
|
|
return vim.command_output('GetContext') == 'math_inline' or vim.command_output('GetContext') == 'math_block'
|
|
|
|
|
|
|
|
def math_inline():
|
|
|
|
return vim.command_output('GetContext') == 'math_inline'
|
|
|
|
|
|
|
|
def math_block():
|
|
|
|
return vim.command_output('GetContext') == 'math_block'
|
|
|
|
endglobal
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
extends html
|
|
|
|
|
2022-05-11 12:08:01 +02:00
|
|
|
# Zettelkasten templating
|
|
|
|
|
|
|
|
snippet nl
|
2022-09-24 11:26:42 +02:00
|
|
|
*Ned.*: $1
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet eng
|
2022-09-24 11:26:42 +02:00
|
|
|
*Eng.*: $1
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet fr
|
2022-09-24 11:26:42 +02:00
|
|
|
*Fr.*: $1
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet (de
|
|
|
|
*De.*: $1
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet (nl
|
|
|
|
(*Ned.*: $1)
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet (eng
|
|
|
|
(*Eng.*: $1)
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet (fr
|
2022-05-11 12:08:01 +02:00
|
|
|
(*Fr.*: $1)
|
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet (de
|
2022-05-11 12:08:01 +02:00
|
|
|
(*De.*: $1)
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet in
|
|
|
|
(In [$1]($2))$3
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:38:13 +02:00
|
|
|
snippet c "Comment (html)"
|
|
|
|
<!-- $1 -->$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet c. "Comment (html) ..." i
|
|
|
|
<!-- ... -->$1
|
|
|
|
endsnippet
|
|
|
|
|
2022-05-11 12:08:01 +02:00
|
|
|
snippet ref "References"
|
|
|
|
<!--references-->
|
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet sort "Sort"
|
|
|
|
<!--sort-->
|
|
|
|
endsnippet
|
|
|
|
|
2022-05-11 12:08:01 +02:00
|
|
|
snippet foot "Footnotes"
|
|
|
|
<!--footnotes-->
|
|
|
|
[^0]:
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet def "Definition"
|
2022-09-24 11:26:42 +02:00
|
|
|
**Definition${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]}
|
2022-05-11 12:08:01 +02:00
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
$7
|
2022-05-11 12:08:01 +02:00
|
|
|
|
|
|
|
___
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet theo "Theorem"
|
2022-09-24 11:26:42 +02:00
|
|
|
**Theorem${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]}
|
2022-05-11 12:08:01 +02:00
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
$7
|
|
|
|
|
|
|
|
${8/(\w+).*/**Theorem** \n\n.../}
|
2022-05-11 12:08:01 +02:00
|
|
|
|
|
|
|
___
|
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet q
|
|
|
|
Your age: ${1|<18,18~60,>60|}
|
|
|
|
Your height: ${2|<120cm,120cm~180cm,>180cm|}
|
|
|
|
endsnippet
|
|
|
|
|
2022-05-11 12:08:01 +02:00
|
|
|
snippet prop "Property"
|
|
|
|
**Property $1** [@]
|
|
|
|
|
|
|
|
$2
|
|
|
|
|
|
|
|
___
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet lemm "Lemma"
|
|
|
|
**Lemma $1** [@]
|
|
|
|
|
|
|
|
$2
|
|
|
|
|
|
|
|
___
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet coro "Corollary"
|
|
|
|
**Corollary $1** [@]
|
|
|
|
|
|
|
|
$2
|
|
|
|
|
|
|
|
___
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
# Zettelkasten to Anki
|
|
|
|
|
|
|
|
snippet td "TARGET DECK: <Deck name>"
|
|
|
|
TARGET DECK: $1::$2
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet clo "Cloze"
|
2022-05-11 12:08:01 +02:00
|
|
|
START
|
|
|
|
Cloze
|
2022-09-24 11:26:42 +02:00
|
|
|
${0:${VISUAL}}$1
|
2022-05-11 12:08:01 +02:00
|
|
|
END
|
|
|
|
$2
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet clos "Cloze start"
|
2022-09-24 11:26:42 +02:00
|
|
|
START
|
|
|
|
Cloze
|
|
|
|
$1
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet cloe "Cloze end"
|
2022-09-24 11:26:42 +02:00
|
|
|
END
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet clod
|
2022-05-11 12:08:01 +02:00
|
|
|
START
|
|
|
|
Cloze
|
|
|
|
**Definition$1**
|
|
|
|
|
|
|
|
$2
|
|
|
|
END
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet clop
|
2022-05-11 12:08:01 +02:00
|
|
|
START
|
|
|
|
Cloze
|
|
|
|
**Property$1**
|
|
|
|
|
|
|
|
$2
|
|
|
|
END
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet clot
|
2022-05-11 12:08:01 +02:00
|
|
|
START
|
|
|
|
Cloze
|
|
|
|
**Theorem$1**
|
|
|
|
|
|
|
|
$2
|
|
|
|
END
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet clol
|
2022-05-11 12:08:01 +02:00
|
|
|
START
|
|
|
|
Cloze
|
|
|
|
**Lemma$1**
|
|
|
|
|
|
|
|
$2
|
|
|
|
END
|
|
|
|
endsnippet
|
|
|
|
|
2023-05-15 13:43:37 +02:00
|
|
|
snippet "c(\d+)" "Cloze <number>" r
|
2022-09-24 11:26:42 +02:00
|
|
|
{{c`!p snip.rv = int(match.group(1))`::${0:${VISUAL}}$1}}$2
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
# MathJax environments
|
2022-05-11 12:08:01 +02:00
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet asaw "Als en slechts als (woorden)" i
|
|
|
|
als en slechts als
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet iffw "If and only if (words)" i
|
|
|
|
if and only if
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet asas "Als en slechts als (shorthand)" i
|
|
|
|
**asa**
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet iffs "If and only if (shorthand)" i
|
|
|
|
**iff**
|
2022-05-11 12:08:01 +02:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet align "" i
|
|
|
|
\begin{align}
|
|
|
|
$1
|
|
|
|
\end{align}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet cases "" i
|
|
|
|
\begin{cases}
|
|
|
|
$1 \\\\
|
|
|
|
$2
|
|
|
|
\end{cases}
|
|
|
|
$3
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet matrix "Matrix" i
|
|
|
|
\begin{bmatrix}
|
|
|
|
$1
|
|
|
|
\end{bmatrix}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet $
|
|
|
|
$$1$$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet $$
|
|
|
|
$$
|
|
|
|
$1
|
|
|
|
$$
|
|
|
|
$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
# MathJax
|
|
|
|
|
|
|
|
snippet fa "For all" i
|
|
|
|
\forall
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet frac "" i
|
|
|
|
\frac{$1}{$2}$3
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet set "" i
|
|
|
|
\\{$1\\}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet N "" i
|
|
|
|
\mathbb{N}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet N0 "" i
|
|
|
|
\mathbb{N}_0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet N+ "" i
|
|
|
|
\mathbb{N}^+
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Z "" i
|
|
|
|
\mathbb{Z}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Z0 "" i
|
|
|
|
\mathbb{Z}_0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Z+ "" i
|
|
|
|
\mathbb{Z}^+
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet R "" i
|
|
|
|
\mathbb{R}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet R0 "" i
|
|
|
|
\mathbb{R}_0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet R+ "" i
|
|
|
|
\mathbb{R}^+
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet C "" i
|
|
|
|
\mathbb{C}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet lim "" i
|
|
|
|
\lim_{$1}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet limn "" i
|
|
|
|
\lim_{n \to \infty}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet binom "" i
|
|
|
|
\binom{$1}{$2}$3
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet andmath "description" i
|
|
|
|
\text{ and }
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet enmath "description" i
|
|
|
|
\text{ en }
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet lra "MathJax: long right arrow" i
|
|
|
|
\longrightarrow
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Ra "MathJax: right arrow" i
|
|
|
|
\Rightarrow
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Im "MathJax: image operator" i
|
|
|
|
\operatorname{Im}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet ggd "Grootste gemene deler" i
|
|
|
|
\operatorname{ggd}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet fl "Floating point" i
|
|
|
|
\operatorname{fl}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Var "Variance" i
|
|
|
|
\operatorname{Var}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet E "Expectation" i
|
|
|
|
\operatorname{E}
|
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet Cov "Covariance" i
|
|
|
|
\operatorname{Cov}
|
|
|
|
endsnippet
|
|
|
|
|
2022-05-11 12:08:01 +02:00
|
|
|
snippet mxn "Matrix" i
|
|
|
|
m \times n
|
|
|
|
endsnippet
|
|
|
|
|
2022-09-24 11:26:42 +02:00
|
|
|
snippet mxn- "Matrix" i
|
|
|
|
$m \times n$-matrix
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet nxn "Matrix" i
|
|
|
|
n \times n
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet det "Determinant" i
|
|
|
|
\operatorname{det}(${1:A})$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet det| "Determinant alternative notation" i
|
|
|
|
|${1:A}|$2
|
|
|
|
endsnippet
|
|
|
|
|
2022-05-11 12:08:01 +02:00
|
|
|
snippet Span "Span" i
|
|
|
|
\operatorname{Span}\\{$1\\}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Nul "Null" i
|
|
|
|
\operatorname{Nul}($1)$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Col "Column space" i
|
|
|
|
\operatorname{Col}($1)$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet kern "Kernel" i
|
|
|
|
\operatorname{kern}($1)$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet vec "Vector" i
|
|
|
|
\mathbf{$1}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet v1tovp "Vectors v indexed from 1 to p" b
|
|
|
|
\mathbf{v_1},...,\mathbf{v_p}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet a1toan "Vectors a indexed from 1 to n" b
|
|
|
|
\mathbf{a_1},...,\mathbf{v_n}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet .. "Dot dot dot" i
|
|
|
|
\dots $1
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet text "MathJax text" i
|
|
|
|
\text{$1}$2
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet leq "Less than or equal to" i
|
|
|
|
\leq
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet leq "Greater than or equal to" i
|
|
|
|
\geq
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet eat "Evaluated at" i
|
|
|
|
{\biggr\rvert}_{$1}$2
|
|
|
|
endsnippet
|
2022-09-24 11:26:42 +02:00
|
|
|
|
|
|
|
snippet sketch "Link a sketch" i
|
|
|
|
[$1](file:///home/h/sketches/$2)
|
|
|
|
endsnippet
|