forked from aziz/PlainTasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlainTasks.sublime-syntax
99 lines (99 loc) · 3.43 KB
/
PlainTasks.sublime-syntax
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
%YAML 1.2
---
name: Tasks
file_extensions:
- todo
- tasks
- todolist.txt
scope: text.todo
contexts:
main:
- match: '^\s*(\#?\s?\w+.*?:\s*?(\@[^\s]+(\(.*?\))?\s*?)*$\n?)'
scope: keyword.control.header.todo
- match: '^\s*(?:(\+|✓|✔|☑|√|\[x\])(\s+(?:[^\@\n]|(?<!\s)\@|\@(?=\s))*)([^\n]*))|^\s*(?:(-)(\s+(?:[^\@]|(?<!\s)\@|\@(?=\s))*)(.*\@done(?=\s|\(|$)[^\n]*))'
scope: meta.item.todo.completed
captures:
1: punctuation.definition.bullet.completed.todo
2: comment.line.completed.todo
3: meta.tag.todo.completed
4: punctuation.definition.bullet.completed.todo
5: comment.line.completed.todo
6: meta.tag.todo.completed
- match: '^\s*(?:(✘|x|\[-\])(\s+(?:[^\@\n]|(?<!\s)\@|\@(?=\s))*)(.*))|^\s*(?:(-)(\s+(?:[^\@]|(?<!\s)\@|\@(?=\s))*)(.*\@cancelled(?=\s|\(|$)[^\n]*))'
scope: meta.item.todo.cancelled
captures:
1: punctuation.definition.bullet.cancelled.todo
2: text.cancelled.todo
3: meta.tag.todo.cancelled
4: punctuation.definition.bullet.cancelled.todo
5: text.cancelled.todo
6: meta.tag.todo.cancelled
- match: '^\s*(?!-|\+|✓|✔|√|❍|❑|■|□|☐|▪|▫|–|—|≡|→|›|\[[\sx-]\]|_|✘|(x\s+))(?=\S)'
push:
- meta_scope: notes.todo
- match: $\n?
pop: true
- include: italic
- include: bold
- include: url
- match: '^\s*(-|❍|❑|■|□|☐|▪|▫|–|—|≡|→|›|\[\s\])(?=(\s+(?:[^\@\n]|(?<![ \t])\@)*)(?!([^\n]*)?(\@done|\@cancelled)[\s\(]))'
captures:
1: punctuation.definition.bullet.pending.todo
push:
- meta_scope: meta.item.todo.pending
- match: $
captures:
1: punctuation.definition.bullet.pending.todo
pop: true
- include: italic
- include: bold
- include: url
- include: tag
- include: today
- include: low
- include: high
- include: critical
- match: ^_+$
scope: meta.punctuation.archive.todo
- match: '^\s*---.{3,5}---+$'
scope: meta.punctuation.separator.todo
bold:
- match: '(?<=\s|^)(\*\*|__)(?=\S)(?=(?!(?<=\S)\1)[^\n]+(?<=\S)\1)(?=[^\n]+(?<=\S)(\1)((?![\w\d\n])|(?=\s|$)))'
captures:
1: punctuation.definition.bold
push:
- meta_scope: todo.bold
- match: '(?<=\S)(\1)((?![\w\d\n])|(?=\s|$))'
captures:
1: punctuation.definition.bold
pop: true
critical:
- match: (?<=\s)\@critical|✭critical
scope: string.other.tag.todo.critical
high:
- match: (?<=\s)\@high|✭high
scope: string.other.tag.todo.high
italic:
- match: '(?<=\s|^)(\*|_)(?=\S)(?=(\1\1|(?!(?<=\S)\1).)++(?<=\S)\1)(?=[^\n]+(?<=\S)(\1)(?!\1|[\w\d]))'
captures:
1: punctuation.definition.italic
push:
- meta_scope: todo.italic
- match: '(?<=\S)(\1)(?!\1|[\w\d])'
captures:
1: punctuation.definition.italic
pop: true
low:
- match: (?<=\s)\@low|✭low
scope: string.other.tag.todo.low
tag:
- match: '(?<=\s)\@(?!(high|today|critical|low|completed|done)[\s\(])[\w\d\.\(\)\-!? :\+]+[ \t]*'
scope: meta.tag.todo
today:
- match: (?<=\s)\@today|✭ᴛᴏᴅᴀʏ
scope: string.other.tag.todo.today
url:
- match: '(?<!\S)(<)\w+?(?!\s)(\.|:)(?!\s)[^\n]+?(>)'
scope: todo.url
captures:
1: punctuation.definition.url