blob: be08de66e3cedc55e3c64e2f7c0d2de0b8021dd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
global !p
def gen_header(snip):
placeholders_string = snip.buffer[snip.line].strip()
level = int(placeholders_string[0])
# erase current line
snip.buffer[snip.line] = ""
line_content = "#"*level + " ${1:Section Name} " + "#"*level
line_content += '\n$0'
snip.expand_anon(line_content)
endglobal
snippet kbd "HTML kbd tag"
<kbd>${1:KEY}</kbd>$0
endsnippet
snippet "meta(data)?" "Markdown front matter in YAML format" br
---
title: "$1"
date: `!p from datetime import datetime
if not snip.c:
snip.rv=datetime.now().astimezone().strftime("%Y-%m-%d %H:%M:%S%z")`
tags: [$2]
categories: [$3]
---
$0
endsnippet
snippet more "HTML more tag"
<!--more-->
endsnippet
snippet img "Aligned image using HTML tag"
<p align="center">
<img src="${1:URL}" width="${2:800}">
</p>
$0
endsnippet
snippet link "Markdown links"
[$1]($2)$0
endsnippet
post_jump "gen_header(snip)"
snippet "h([1-6])" "Markdown header" br
`!p snip.rv = match.group(1)`
endsnippet
snippet detail "Clickable details" b
<details>
<summary><font size="2" color="red">${1:Click to show the code.}</font></summary>
$2
</details>
endsnippet
|