blob: 09c99c1d56428a4c07948bd397df075eca667800 [file] [log] [blame]
Amelia Clarke35dfe582024-05-24 08:05:00 +02001" Vim syntax file.
2" Language: Haredoc (Hare documentation format)
3" Maintainer: Amelia Clarke <selene@perilune.dev>
4" Last Change: 2024-05-10
5" Upstream: https://git.sr.ht/~selene/hare.vim
6
7if exists('b:current_syntax')
8 finish
9endif
10let b:current_syntax = 'haredoc'
11
12" Syntax {{{1
13syn case match
14syn iskeyword @,48-57,_
15
16" Code samples.
17syn region haredocCodeSample excludenl start='\t\zs' end='$' contains=@NoSpell display
18
19" References to other declarations and modules.
20syn region haredocRef start='\[\[' end=']]' contains=haredocRefValid,@NoSpell display keepend oneline
21syn match haredocRefValid '\v\[\[\h\w*%(::\h\w*)*%(::)?]]' contained contains=@NoSpell display
22
23" Miscellaneous.
24syn keyword haredocTodo FIXME TODO XXX
25
26" Default highlighting {{{1
27hi def link haredocCodeSample Comment
28hi def link haredocRef Error
29hi def link haredocRefValid Special
30hi def link haredocTodo Todo
31
32" vim: et sts=2 sw=2 ts=8