dune.vim (2078B)
1 " Vim syntax file 2 " Language: Dune buildsystem 3 " Maintainer: Markus Mottl <markus.mottl@gmail.com> 4 " Anton Kochkov <anton.kochkov@gmail.com> 5 " URL: https://github.com/ocaml/vim-ocaml 6 " Last Change: 7 " 2023 Nov 24 - Add end-of-line strings (Samuel Hym) 8 " 2019 Feb 27 - Add newer keywords to the syntax (Simon Cruanes) 9 " 2018 May 8 - Check current_syntax (Kawahara Satoru) 10 " 2018 Mar 29 - Extend jbuild syntax with more keywords (Petter A. Urkedal) 11 " 2017 Sep 6 - Initial version (Etienne Millon) 12 13 if exists("b:current_syntax") 14 finish 15 endif 16 17 set syntax=lisp 18 syn case match 19 20 " The syn-iskeyword setting lacks #,? from the iskeyword setting here. 21 " Clearing it avoids maintaining keyword characters in multiple places. 22 syn iskeyword clear 23 24 syn keyword lispDecl jbuild_version library executable executables rule ocamllex ocamlyacc menhir alias install 25 26 syn keyword lispKey name public_name synopsis modules libraries wrapped 27 syn keyword lispKey preprocess preprocessor_deps optional c_names cxx_names 28 syn keyword lispKey install_c_headers modes no_dynlink self_build_stubs_archive 29 syn keyword lispKey ppx_runtime_libraries virtual_deps js_of_ocaml link_flags 30 syn keyword lispKey javascript_files flags ocamlc_flags ocamlopt_flags pps staged_pps 31 syn keyword lispKey library_flags c_flags c_library_flags kind package action 32 syn keyword lispKey deps targets locks fallback 33 syn keyword lispKey inline_tests tests test names 34 35 syn keyword lispAtom true false 36 37 syn keyword lispFunc cat chdir copy# diff? echo run setenv 38 syn keyword lispFunc ignore-stdout ignore-stderr ignore-outputs 39 syn keyword lispFunc with-stdout-to with-stderr-to with-outputs-to 40 syn keyword lispFunc write-file system bash 41 42 syn region lispString start=+"\\[>|]+ end=+$+ contains=@Spell 43 44 syn cluster lispBaseListCluster add=duneVar 45 syn match duneVar '\${[@<^]}' containedin=lispSymbol 46 syn match duneVar '\${\k\+\(:\k\+\)\?}' containedin=lispSymbol 47 48 hi def link duneVar Identifier 49 50 let b:current_syntax = "dune"