19964e468SBram Moolenaar" Vim syntax file 29964e468SBram Moolenaar" Language: initng .i files 3*cb80aa2dSBram Moolenaar" Maintainer: Elan Ruusamäe <[email protected]> 49964e468SBram Moolenaar" URL: http://glen.alkohol.ee/pld/initng/ 59964e468SBram Moolenaar" License: GPL v2 69964e468SBram Moolenaar" Version: 0.13 75c73622aSBram Moolenaar" Last Change: $Date: 2007/05/05 17:17:40 $ 89964e468SBram Moolenaar" 99964e468SBram Moolenaar" Syntax highlighting for initng .i files. Inherits from sh.vim and adds 109964e468SBram Moolenaar" in the hiliting to start/stop {} blocks. Requires vim 6.3 or later. 119964e468SBram Moolenaar 129964e468SBram Moolenaarif &compatible || v:version < 603 139964e468SBram Moolenaar finish 149964e468SBram Moolenaarendif 159964e468SBram Moolenaar 169964e468SBram Moolenaarif exists("b:current_syntax") 179964e468SBram Moolenaar finish 189964e468SBram Moolenaarendif 199964e468SBram Moolenaar 209964e468SBram Moolenaarsyn case match 219964e468SBram Moolenaar 229964e468SBram Moolenaarlet is_bash = 1 239964e468SBram Moolenaarunlet! b:current_syntax 249964e468SBram Moolenaarsyn include @shTop syntax/sh.vim 259964e468SBram Moolenaar 269964e468SBram Moolenaarsyn region initngService matchgroup=initngServiceHeader start="^\s*\(service\|virtual\|daemon\|class\|cron\)\s\+\(\(\w\|[-/*]\)\+\(\s\+:\s\+\(\w\|[-/*]\)\+\)\?\)\s\+{" end="}" contains=@initngServiceCluster 279964e468SBram Moolenaarsyn cluster initngServiceCluster contains=initngComment,initngAction,initngServiceOption,initngServiceHeader,initngDelim,initngVariable 289964e468SBram Moolenaar 299964e468SBram Moolenaarsyn region initngAction matchgroup=initngActionHeader start="^\s*\(script start\|script stop\|script run\)\s*=\s*{" end="}" contains=@initngActionCluster 309964e468SBram Moolenaarsyn cluster initngActionCluster contains=@shTop 319964e468SBram Moolenaar 329964e468SBram Moolenaarsyn match initngDelim /[{}]/ contained 339964e468SBram Moolenaar 349964e468SBram Moolenaarsyn region initngString start=/"/ end=/"/ skip=/\\"/ 359964e468SBram Moolenaar 369964e468SBram Moolenaar" option = value 379964e468SBram Moolenaarsyn match initngServiceOption /.\+\s*=.\+;/ contains=initngServiceKeywords,initngSubstMacro contained 389964e468SBram Moolenaar" option without value 399964e468SBram Moolenaarsyn match initngServiceOption /\w\+;/ contains=initngServiceKeywords,initngSubstMacro contained 409964e468SBram Moolenaar 419964e468SBram Moolenaar" options with value 429964e468SBram Moolenaarsyn keyword initngServiceKeywords also_stop need use nice setuid contained 439964e468SBram Moolenaarsyn keyword initngServiceKeywords delay chdir suid sgid start_pause env_file env_parse pid_file pidfile contained 449964e468SBram Moolenaarsyn keyword initngServiceKeywords pid_of up_when_pid_set stdout stderr syncron just_before contained 459964e468SBram Moolenaarsyn keyword initngServiceKeywords provide lockfile daemon_stops_badly contained 469964e468SBram Moolenaarsyn match initngServiceKeywords /\(script\|exec\(_args\)\?\) \(start\|stop\|daemon\)/ contained 479964e468SBram Moolenaarsyn match initngServiceKeywords /env\s\+\w\+/ contained 489964e468SBram Moolenaar 499964e468SBram Moolenaar" rlimits 509964e468SBram Moolenaarsyn keyword initngServiceKeywords rlimit_cpu_hard rlimit_core_soft contained 519964e468SBram Moolenaar 529964e468SBram Moolenaar" single options 539964e468SBram Moolenaarsyn keyword initngServiceKeywords last respawn network_provider require_network require_file critical forks contained 549964e468SBram Moolenaar" cron options 559964e468SBram Moolenaarsyn keyword initngServiceKeywords hourly contained 569964e468SBram Moolenaarsyn match initngVariable /\${\?\w\+\}\?/ 579964e468SBram Moolenaar 589964e468SBram Moolenaar" Substituted @foo@ macros: 599964e468SBram Moolenaar" ========== 609964e468SBram Moolenaarsyn match initngSubstMacro /@[^@]\+@/ contained 619964e468SBram Moolenaarsyn cluster initngActionCluster add=initngSubstMacro 629964e468SBram Moolenaarsyn cluster shCommandSubList add=initngSubstMacro 639964e468SBram Moolenaar 649964e468SBram Moolenaar" Comments: 659964e468SBram Moolenaar" ========== 669964e468SBram Moolenaarsyn cluster initngCommentGroup contains=initngTodo,@Spell 679964e468SBram Moolenaarsyn keyword initngTodo TODO FIXME XXX contained 689964e468SBram Moolenaarsyn match initngComment /#.*$/ contains=@initngCommentGroup 699964e468SBram Moolenaar 709964e468SBram Moolenaar" install_service #macros 719964e468SBram Moolenaar" TODO: syntax check for ifd-endd pairs 729964e468SBram Moolenaar" ========== 739964e468SBram Moolenaarsyn region initngDefine start="^#\(endd\|elsed\|exec\|ifd\|endexec\|endd\)\>" skip="\\$" end="$" end="#"me=s-1 749964e468SBram Moolenaarsyn cluster shCommentGroup add=initngDefine 759964e468SBram Moolenaarsyn cluster initngCommentGroup add=initngDefine 769964e468SBram Moolenaar 779964e468SBram Moolenaarhi def link initngComment Comment 789964e468SBram Moolenaarhi def link initngTodo Todo 799964e468SBram Moolenaar 809964e468SBram Moolenaarhi def link initngString String 819964e468SBram Moolenaarhi def link initngServiceKeywords Define 829964e468SBram Moolenaar 839964e468SBram Moolenaarhi def link initngServiceHeader Keyword 849964e468SBram Moolenaarhi def link initngActionHeader Type 859964e468SBram Moolenaarhi def link initngDelim Delimiter 869964e468SBram Moolenaar 879964e468SBram Moolenaarhi def link initngVariable PreProc 889964e468SBram Moolenaarhi def link initngSubstMacro Comment 899964e468SBram Moolenaarhi def link initngDefine Macro 909964e468SBram Moolenaar 919964e468SBram Moolenaarlet b:current_syntax = "initng" 92