summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/opam.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/opam.vim')
-rw-r--r--runtime/syntax/opam.vim52
1 files changed, 44 insertions, 8 deletions
diff --git a/runtime/syntax/opam.vim b/runtime/syntax/opam.vim
index 9ac1d41..da29662 100644
--- a/runtime/syntax/opam.vim
+++ b/runtime/syntax/opam.vim
@@ -1,5 +1,5 @@
" Vim syntax file
-" Language: OPAM - OCaml package manager
+" Language: opam - OCaml package manager
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
" URL: https://github.com/ocaml/vim-ocaml
" Last Change:
@@ -11,20 +11,55 @@ 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 iskeyword a-z,A-Z,-
+syn keyword opamKeyword1 author
+syn keyword opamKeyword1 authors
+syn keyword opamKeyword1 available
+syn keyword opamKeyword1 bug-reports
+syn keyword opamKeyword1 build
+syn keyword opamKeyword1 build-env
+syn keyword opamKeyword1 conflict-class
+syn keyword opamKeyword1 conflicts
+syn keyword opamKeyword1 depends
+syn keyword opamKeyword1 depexts
+syn keyword opamKeyword1 depopts
+syn keyword opamKeyword1 description
+syn keyword opamKeyword1 dev-repo
+syn keyword opamKeyword1 doc
+syn keyword opamKeyword1 extra-files
+syn keyword opamKeyword1 features
+syn keyword opamKeyword1 flags
+syn keyword opamKeyword1 homepage
+syn keyword opamKeyword1 install
+syn keyword opamKeyword1 libraries
+syn keyword opamKeyword1 license
+syn keyword opamKeyword1 maintainer
+syn keyword opamKeyword1 messages
+syn keyword opamKeyword1 name
+syn keyword opamKeyword1 opam-version
+syn keyword opamKeyword1 patches
+syn keyword opamKeyword1 pin-depends
+syn keyword opamKeyword1 post-messages
+syn keyword opamKeyword1 remove
+syn keyword opamKeyword1 run-test
+syn keyword opamKeyword1 setenv
+syn keyword opamKeyword1 substs
+syn keyword opamKeyword1 synopsis
+syn keyword opamKeyword1 syntax
+syn keyword opamKeyword1 tags
+syn keyword opamKeyword1 version
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
+syn match opamUnclosedInterpolate "%{[^ "]*" contained
+syn match opamInterpolate "%{[^ "]\+}%" contained
+syn region opamString start=/"/ end=/"/ contains=opamInterpolate,OpamUnclosedInterpolate
+syn region opamSeq start=/\[/ end=/\]/ contains=ALLBUT,opamKeyword1
+syn region opamExp start=/{/ end=/}/ contains=ALLBUT,opamKeyword1
hi link opamKeyword1 Keyword
-hi link opamKeyword2 Keyword
hi link opamString String
hi link opamExp Function
@@ -32,6 +67,7 @@ hi link opamSeq Statement
hi link opamOperator Operator
hi link opamComment Comment
hi link opamInterpolate Identifier
+hi link opamUnclosedInterpolate Error
let b:current_syntax = "opam"