initng.vim (3375B)
1 " Vim syntax file 2 " Language: initng .i files 3 " Maintainer: Elan Ruusamäe <glen@pld-linux.org> 4 " URL: http://glen.alkohol.ee/pld/initng/ 5 " License: GPL v2 6 " Version: 0.13 7 " Last Change: $Date: 2007/05/05 17:17:40 $ 8 " 9 " Syntax highlighting for initng .i files. Inherits from sh.vim and adds 10 " in the hiliting to start/stop {} blocks. Requires vim 6.3 or later. 11 12 if &compatible || v:version < 603 13 finish 14 endif 15 16 if exists("b:current_syntax") 17 finish 18 endif 19 20 syn case match 21 22 let is_bash = 1 23 syn include @shTop syntax/sh.vim 24 25 syn region initngService matchgroup=initngServiceHeader start="^\s*\(service\|virtual\|daemon\|class\|cron\)\s\+\(\(\w\|[-/*]\)\+\(\s\+:\s\+\(\w\|[-/*]\)\+\)\?\)\s\+{" end="}" contains=@initngServiceCluster 26 syn cluster initngServiceCluster contains=initngComment,initngAction,initngServiceOption,initngServiceHeader,initngDelim,initngVariable 27 28 syn region initngAction matchgroup=initngActionHeader start="^\s*\(script start\|script stop\|script run\)\s*=\s*{" end="}" contains=@initngActionCluster 29 syn cluster initngActionCluster contains=@shTop 30 31 syn match initngDelim /[{}]/ contained 32 33 syn region initngString start=/"/ end=/"/ skip=/\\"/ 34 35 " option = value 36 syn match initngServiceOption /.\+\s*=.\+;/ contains=initngServiceKeywords,initngSubstMacro contained 37 " option without value 38 syn match initngServiceOption /\w\+;/ contains=initngServiceKeywords,initngSubstMacro contained 39 40 " options with value 41 syn keyword initngServiceKeywords also_stop need use nice setuid contained 42 syn keyword initngServiceKeywords delay chdir suid sgid start_pause env_file env_parse pid_file pidfile contained 43 syn keyword initngServiceKeywords pid_of up_when_pid_set stdout stderr syncron just_before contained 44 syn keyword initngServiceKeywords provide lockfile daemon_stops_badly contained 45 syn match initngServiceKeywords /\(script\|exec\(_args\)\?\) \(start\|stop\|daemon\)/ contained 46 syn match initngServiceKeywords /env\s\+\w\+/ contained 47 48 " rlimits 49 syn keyword initngServiceKeywords rlimit_cpu_hard rlimit_core_soft contained 50 51 " single options 52 syn keyword initngServiceKeywords last respawn network_provider require_network require_file critical forks contained 53 " cron options 54 syn keyword initngServiceKeywords hourly contained 55 syn match initngVariable /\${\?\w\+\}\?/ 56 57 " Substituted @foo@ macros: 58 " ========== 59 syn match initngSubstMacro /@[^@]\+@/ contained 60 syn cluster initngActionCluster add=initngSubstMacro 61 syn cluster shCommandSubList add=initngSubstMacro 62 63 " Comments: 64 " ========== 65 syn cluster initngCommentGroup contains=initngTodo,@Spell 66 syn keyword initngTodo TODO FIXME XXX contained 67 syn match initngComment /#.*$/ contains=@initngCommentGroup 68 69 " install_service #macros 70 " TODO: syntax check for ifd-endd pairs 71 " ========== 72 syn region initngDefine start="^#\(endd\|elsed\|exec\|ifd\|endexec\|endd\)\>" skip="\\$" end="$" end="#"me=s-1 73 syn cluster shCommentGroup add=initngDefine 74 syn cluster initngCommentGroup add=initngDefine 75 76 hi def link initngComment Comment 77 hi def link initngTodo Todo 78 79 hi def link initngString String 80 hi def link initngServiceKeywords Define 81 82 hi def link initngServiceHeader Keyword 83 hi def link initngActionHeader Type 84 hi def link initngDelim Delimiter 85 86 hi def link initngVariable PreProc 87 hi def link initngSubstMacro Comment 88 hi def link initngDefine Macro 89 90 let b:current_syntax = "initng"