aboutsummaryrefslogtreecommitdiffhomepage
path: root/sundry/editor-syntax-etc/nvim/queries/sisu/highlights.scm
blob: 3454bd494dcbb24a409c503590e966ba0fd18455 (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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
; Syntax highlighting queries for SiSU Spine markup
; Compatible with tree-sitter highlight capture names from
; https://tree-sitter.github.io/tree-sitter/syntax-highlighting

; =================================================================
; Comments
; =================================================================
(version_comment) @comment.documentation
(header_comment) @comment
(body_comment) @comment

; =================================================================
; Header (document metadata)
; =================================================================
(header_field
  key: (header_key) @keyword)

(header_field
  value: (header_value) @string)

(header_continuation) @string

; =================================================================
; Headings
; =================================================================
(part_marker) @keyword.directive
(segment_marker) @keyword.directive

(heading_part
  content: (heading_content) @markup.heading)

(heading_segment
  content: (heading_content) @markup.heading)

(segment_name) @label
(suppress_marker) @punctuation.special

; Heading levels for more specific styling
(heading_part
  marker: (part_marker) @markup.heading.1
  (#match? @markup.heading.1 "^:A~$"))

(heading_part
  marker: (part_marker) @markup.heading.2
  (#match? @markup.heading.2 "^:B~$"))

(heading_part
  marker: (part_marker) @markup.heading.3
  (#match? @markup.heading.3 "^:C~$"))

(heading_part
  marker: (part_marker) @markup.heading.4
  (#match? @markup.heading.4 "^:D~$"))

(heading_segment
  marker: (segment_marker) @markup.heading.5
  (#match? @markup.heading.5 "^1~$"))

(heading_segment
  marker: (segment_marker) @markup.heading.6
  (#match? @markup.heading.6 "^2~$"))

; =================================================================
; Inline formatting
; =================================================================
(emphasis) @markup.italic
(bold) @markup.bold
(italic) @markup.italic
(underline) @markup.underline
(citation_mark) @markup.quote
(superscript) @markup.superscript
(subscript) @markup.subscript
(inserted) @markup.underline
(strikethrough) @markup.strikethrough
(monospace_inline) @markup.raw

; Formatting delimiters
["*{" "}*"] @punctuation.special
["!{" "}!"] @punctuation.special
["/{" "}/"] @punctuation.special
["_{" "}_"] @punctuation.special
["\"{" "}\""] @punctuation.special
["^{" "}^"] @punctuation.special
[",{" "},"] @punctuation.special
["+{" "}+"] @punctuation.special
["-{" "}-"] @punctuation.special
["#{" "}#"] @punctuation.special

; =================================================================
; Footnotes and editor notes
; =================================================================
(footnote) @markup.link
(footnote_marker) @punctuation.special
(editor_note) @markup.link

["~{" "}~"] @punctuation.special
; Editor-note channel selector: ~[* (asterisk set) or ~[+ (plus set).
; A distinct capture lets themes colour the two channels separately
; from the generic footnote delimiters above.
(editor_note_marker) @attribute
["]~"] @punctuation.special

; =================================================================
; Links and images
; =================================================================
(link
  text: (link_text) @markup.link.label)

(link
  target: (url) @markup.link.url)

(link
  target: (anchor_ref) @markup.link.url)

(link
  target: (collection_path) @markup.link.url)

(auto_footnote_marker) @punctuation.special

(image
  spec: (image_spec) @markup.link.label)

(url) @markup.link.url

(inline_anchor) @label
(anchor_name) @label

; =================================================================
; Block elements
; =================================================================
(block_open) @keyword.directive
(block_close) @keyword.directive
(raw_content) @markup.raw

; Code blocks get more specific highlighting
(code_block_curly
  open: (block_open) @keyword.directive)
(code_block_curly
  content: (raw_content) @markup.raw.block)
(code_block_curly
  close: (block_close) @keyword.directive)

(code_block_tic
  open: (block_open) @keyword.directive)
(code_block_tic
  content: (raw_content) @markup.raw.block)
(code_block_tic
  close: (block_close) @keyword.directive)

; =================================================================
; Book index
; =================================================================
(book_index) @markup.list
(index_content) @string

; =================================================================
; Paragraph prefixes
; =================================================================
(paragraph_prefix) @punctuation.special

; =================================================================
; Special markers
; =================================================================
(ocn_suppress) @comment
(ocn_suppress_open) @comment
(ocn_suppress_close) @comment

(page_break) @punctuation.special
(horizontal_rule) @punctuation.special

; =================================================================
; Composite includes
; =================================================================
(composite_include) @keyword.import
(include_path) @string.special.path

; =================================================================
; Pipe table
; =================================================================
(table_spec) @keyword.directive
(table_row) @markup.raw

; =================================================================
; Text
; =================================================================
(text) @spell

; Line break
(line_break) @punctuation.special