blob: bd5c89d30f8241d9b12363f873cae4cc98ba1b0f [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Apache-Style configuration files (proftpd.conf/apache.conf/..)
Bram Moolenaarf0b03c42017-12-17 17:17:07 +01003" Maintainer: Ben RUBSON <ben.rubson@gmail.com>
4" Former Maintainer: Christian Hammers <ch@westend.com>
Bram Moolenaar071d4272004-06-13 20:20:40 +00005" ChangeLog:
Bram Moolenaarf0b03c42017-12-17 17:17:07 +01006" 2017-12-17,ch
7" correctly detect comments
Bram Moolenaar071d4272004-06-13 20:20:40 +00008" 2001-05-04,ch
9" adopted Vim 6.0 syntax style
10" 1999-10-28,ch
11" initial release
12
13" The following formats are recognised:
14" Apache-style .conf
15" # Comment
16" Option value
17" Option value1 value2
18" Option = value1 value2 #not apache but also allowed
19" <Section Name?>
20" Option value
21" <SubSection Name?>
22" </SubSection>
23" </Section>
24
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020025" quit when a syntax file was already loaded
26if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000027 finish
28endif
29
30syn case ignore
31
Bram Moolenaar071d4272004-06-13 20:20:40 +000032syn match apOption /^\s*[^ \t#<=]*/
Bram Moolenaarf0b03c42017-12-17 17:17:07 +010033syn match apComment /^\s*#.*$/
Bram Moolenaar071d4272004-06-13 20:20:40 +000034"syn match apLastValue /[^ \t<=#]*$/ contains=apComment ugly
35
36" tags
37syn region apTag start=/</ end=/>/ contains=apTagOption,apTagError
38" the following should originally be " [^<>]+" but this didn't work :(
39syn match apTagOption contained / [-\/_\.:*a-zA-Z0-9]\+/ms=s+1
40syn match apTagError contained /[^>]</ms=s+1
41
42" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020043" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000044
Bram Moolenaarf37506f2016-08-31 22:22:10 +020045hi def link apComment Comment
46hi def link apOption Keyword
47"hi def link apLastValue Identifier ugly?
48hi def link apTag Special
49hi def link apTagOption Identifier
50hi def link apTagError Error
Bram Moolenaar071d4272004-06-13 20:20:40 +000051
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
53let b:current_syntax = "apachestyle"
54" vim: ts=8