summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/ondir.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
commit08f9ab81d4c476bdca6e23aba00f615eb811d929 (patch)
treece8796843acf3fd4f1ab43490d74f56131772037 /runtime/syntax/ondir.vim
parentAdding debian version 2:9.1.0199-1. (diff)
downloadvim-08f9ab81d4c476bdca6e23aba00f615eb811d929.tar.xz
vim-08f9ab81d4c476bdca6e23aba00f615eb811d929.zip
Merging upstream version 2:9.1.0374.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/ondir.vim')
-rw-r--r--runtime/syntax/ondir.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/runtime/syntax/ondir.vim b/runtime/syntax/ondir.vim
new file mode 100644
index 0000000..4aeb014
--- /dev/null
+++ b/runtime/syntax/ondir.vim
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language: ondir <https://github.com/alecthomas/ondir>
+" Maintainer: Jon Parise <jon@indelible.org>
+
+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: