config.vim 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. " Vim syntax file
  2. " Language: configure.in script: M4 with sh
  3. " Former Maintainer: Christian Hammesr <ch@lathspell.westend.com>
  4. " Last Change: 2018 Feb 03
  5. " (patch from Yngve Inntjore Levinsen to detect AC_MSG)
  6. " (patch from Khym Chanur to add @Spell)
  7. " (patch from James McCoy to fix paren matching)
  8. " Well, I actually even do not know much about m4. This explains why there
  9. " is probably very much missing here, yet !
  10. " But I missed good highlighting when editing my GNU autoconf/automake
  11. " script, so I wrote this quick and dirty patch.
  12. " quit when a syntax file was already loaded
  13. if exists("b:current_syntax")
  14. finish
  15. endif
  16. " define the config syntax
  17. syn match configdelimiter "[()\[\];,]"
  18. syn match configoperator "[=|&\*\+\<\>]"
  19. syn match configcomment "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
  20. syn match configfunction "\<[A-Z_][A-Z0-9_]*\>"
  21. syn match confignumber "[-+]\=\<\d\+\(\.\d*\)\=\>"
  22. syn keyword configDnl dnl contained
  23. syn keyword configkeyword if then else fi test for in do done
  24. syn keyword configspecial cat rm eval
  25. " This shortens the script, see syn-ext-match..
  26. syn region configstring start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
  27. " Anything inside AC_MSG_TYPE([...]) and AC_MSG_TYPE(...) is a string.
  28. syn region configmsg matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
  29. syn region configmsg matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
  30. " Define the default highlighting.
  31. " Only when an item doesn't have highlighting yet
  32. hi def link configdelimiter Delimiter
  33. hi def link configoperator Operator
  34. hi def link configcomment Comment
  35. hi def link configDnl Comment
  36. hi def link configfunction Function
  37. hi def link confignumber Number
  38. hi def link configkeyword Keyword
  39. hi def link configspecial Special
  40. hi def link configstring String
  41. hi def link configmsg String
  42. let b:current_syntax = "config"
  43. " vim: ts=4