Amelia Clarke | 35dfe58 | 2024-05-24 08:05:00 +0200 | [diff] [blame] | 1 | " 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 | |
| 7 | if exists('b:current_syntax') |
| 8 | finish |
| 9 | endif |
| 10 | let b:current_syntax = 'haredoc' |
| 11 | |
| 12 | " Syntax {{{1 |
| 13 | syn case match |
| 14 | syn iskeyword @,48-57,_ |
| 15 | |
| 16 | " Code samples. |
| 17 | syn region haredocCodeSample excludenl start='\t\zs' end='$' contains=@NoSpell display |
| 18 | |
| 19 | " References to other declarations and modules. |
| 20 | syn region haredocRef start='\[\[' end=']]' contains=haredocRefValid,@NoSpell display keepend oneline |
| 21 | syn match haredocRefValid '\v\[\[\h\w*%(::\h\w*)*%(::)?]]' contained contains=@NoSpell display |
| 22 | |
| 23 | " Miscellaneous. |
| 24 | syn keyword haredocTodo FIXME TODO XXX |
| 25 | |
| 26 | " Default highlighting {{{1 |
| 27 | hi def link haredocCodeSample Comment |
| 28 | hi def link haredocRef Error |
| 29 | hi def link haredocRefValid Special |
| 30 | hi def link haredocTodo Todo |
| 31 | |
| 32 | " vim: et sts=2 sw=2 ts=8 |