apachestyle.vim 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. " Vim syntax file
  2. " Language: Apache-Style configuration files (proftpd.conf/apache.conf/..)
  3. " Maintainer: Ben RUBSON <ben.rubson@gmail.com>
  4. " Former Maintainer: Christian Hammers <ch@westend.com>
  5. " ChangeLog:
  6. " 2017-12-17,ch
  7. " correctly detect comments
  8. " 2001-05-04,ch
  9. " adopted Vim 6.0 syntax style
  10. " 1999-10-28,ch
  11. " initial release
  12. " The following formats are recognised:
  13. " Apache-style .conf
  14. " # Comment
  15. " Option value
  16. " Option value1 value2
  17. " Option = value1 value2 #not apache but also allowed
  18. " <Section Name?>
  19. " Option value
  20. " <SubSection Name?>
  21. " </SubSection>
  22. " </Section>
  23. " quit when a syntax file was already loaded
  24. if exists("b:current_syntax")
  25. finish
  26. endif
  27. syn case ignore
  28. syn match apOption /^\s*[^ \t#<=]*/
  29. syn match apComment /^\s*#.*$/
  30. "syn match apLastValue /[^ \t<=#]*$/ contains=apComment ugly
  31. " tags
  32. syn region apTag start=/</ end=/>/ contains=apTagOption,apTagError
  33. " the following should originally be " [^<>]+" but this didn't work :(
  34. syn match apTagOption contained / [-\/_\.:*a-zA-Z0-9]\+/ms=s+1
  35. syn match apTagError contained /[^>]</ms=s+1
  36. " Define the default highlighting.
  37. " Only when an item doesn't have highlighting yet
  38. hi def link apComment Comment
  39. hi def link apOption Keyword
  40. "hi def link apLastValue Identifier ugly?
  41. hi def link apTag Special
  42. hi def link apTagOption Identifier
  43. hi def link apTagError Error
  44. let b:current_syntax = "apachestyle"
  45. " vim: ts=8