robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Christian Clasonvim-patch:9.1.0366: filetype: ondir files are not recognizedaef120d1e9

master
1.0 KiB35 linesraw
1" 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: