summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/opam.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
commitaed8ce9da277f5ecffe968b324f242c41c3b752a (patch)
treed2e538394cb7a8a7c42a4aac6ccf1a8e3256999b /runtime/syntax/opam.vim
parentInitial commit. (diff)
downloadvim-aed8ce9da277f5ecffe968b324f242c41c3b752a.tar.xz
vim-aed8ce9da277f5ecffe968b324f242c41c3b752a.zip
Adding upstream version 2:9.0.1378.upstream/2%9.0.1378upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/opam.vim')
-rw-r--r--runtime/syntax/opam.vim38
1 files changed, 38 insertions, 0 deletions
diff --git a/runtime/syntax/opam.vim b/runtime/syntax/opam.vim
new file mode 100644
index 0000000..9ac1d41
--- /dev/null
+++ b/runtime/syntax/opam.vim
@@ -0,0 +1,38 @@
+" Vim syntax file
+" Language: OPAM - OCaml package manager
+" Maintainer: Markus Mottl <markus.mottl@gmail.com>
+" URL: https://github.com/ocaml/vim-ocaml
+" Last Change:
+" 2020 Dec 31 - Added header (Markus Mottl)
+
+if exists("b:current_syntax")
+ finish
+endif
+
+" need %{vars}%
+" env: [[CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs"]]
+syn keyword opamKeyword1 remove depends pin-depends depopts conflicts env packages patches version maintainer tags license homepage authors doc install author available name depexts substs synopsis description
+syn match opamKeyword2 "\v(bug-reports|post-messages|ocaml-version|opam-version|dev-repo|build-test|build-doc|build)"
+
+syn keyword opamTodo FIXME NOTE NOTES TODO XXX contained
+syn match opamComment "#.*$" contains=opamTodo,@Spell
+syn match opamOperator ">\|<\|=\|<=\|>="
+
+syn region opamInterpolate start=/%{/ end=/}%/ contained
+syn region opamString start=/"/ end=/"/ contains=opamInterpolate
+syn region opamSeq start=/\[/ end=/\]/ contains=ALLBUT,opamKeyword1,opamKeyword2
+syn region opamExp start=/{/ end=/}/ contains=ALLBUT,opamKeyword1,opamKeyword2
+
+hi link opamKeyword1 Keyword
+hi link opamKeyword2 Keyword
+
+hi link opamString String
+hi link opamExp Function
+hi link opamSeq Statement
+hi link opamOperator Operator
+hi link opamComment Comment
+hi link opamInterpolate Identifier
+
+let b:current_syntax = "opam"
+
+" vim: ts=2 sw=2