From ea999037a41292b3d3e00700a87a82fe5d2c12b2 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 22 Apr 2024 21:07:41 +0200 Subject: patch 9.1.0366: filetype: ondir files are not recognized Problem: filetype: ondir files are not recognized Solution: Detect '.ondirrc' as ondir filetype (Jon Parise) closes: #14604 Signed-off-by: Jon Parise Signed-off-by: Christian Brabandt --- runtime/syntax/ondir.vim | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 runtime/syntax/ondir.vim (limited to 'runtime/syntax') diff --git a/runtime/syntax/ondir.vim b/runtime/syntax/ondir.vim new file mode 100644 index 0000000000..4aeb014e1b --- /dev/null +++ b/runtime/syntax/ondir.vim @@ -0,0 +1,35 @@ +" Vim syntax file +" Language: ondir +" Maintainer: Jon Parise + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpoptions +set cpoptions&vim + +syn case match + +syn match ondirComment "#.*" contains=@Spell +syn keyword ondirKeyword final contained skipwhite nextgroup=ondirKeyword +syn keyword ondirKeyword enter leave contained skipwhite nextgroup=ondirPath +syn match ondirPath "[^:]\+" contained display +syn match ondirColon ":" contained display + +syn include @ondirShell syntax/sh.vim +syn region ondirContent start="^\s\+" end="^\ze\S.*$" keepend contained contains=@ondirShell + +syn region ondirSection start="^\(final\|enter\|leave\)" end="^\ze\S.*$" fold contains=ondirKeyword,ondirPath,ondirColon,ondirContent + +hi def link ondirComment Comment +hi def link ondirKeyword Keyword +hi def link ondirPath Special +hi def link ondirColon Operator + +let b:current_syntax = 'ondir' + +let &cpoptions = s:cpo_save +unlet s:cpo_save + +" vim: et ts=4 sw=2 sts=2: -- cgit v1.2.3