blob: 4aeb014e1b2ab369eb567b5fc18d76a255fe34c1 [file] [log] [blame]
Jon Pariseea999032024-04-22 21:07:41 +02001" Vim syntax file
2" Language: ondir <https://github.com/alecthomas/ondir>
3" Maintainer: Jon Parise <jon@indelible.org>
4
5if exists('b:current_syntax')
6 finish
7endif
8
9let s:cpo_save = &cpoptions
10set cpoptions&vim
11
12syn case match
13
14syn match ondirComment "#.*" contains=@Spell
15syn keyword ondirKeyword final contained skipwhite nextgroup=ondirKeyword
16syn keyword ondirKeyword enter leave contained skipwhite nextgroup=ondirPath
17syn match ondirPath "[^:]\+" contained display
18syn match ondirColon ":" contained display
19
20syn include @ondirShell syntax/sh.vim
21syn region ondirContent start="^\s\+" end="^\ze\S.*$" keepend contained contains=@ondirShell
22
23syn region ondirSection start="^\(final\|enter\|leave\)" end="^\ze\S.*$" fold contains=ondirKeyword,ondirPath,ondirColon,ondirContent
24
25hi def link ondirComment Comment
26hi def link ondirKeyword Keyword
27hi def link ondirPath Special
28hi def link ondirColon Operator
29
30let b:current_syntax = 'ondir'
31
32let &cpoptions = s:cpo_save
33unlet s:cpo_save
34
35" vim: et ts=4 sw=2 sts=2: