cfg.vim 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. " Vim syntax file
  2. " Language: Good old CFG files
  3. " Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
  4. " Last change: 2012 Aug 11
  5. " quit when a syntax file was already loaded
  6. if exists ("b:current_syntax")
  7. finish
  8. endif
  9. " case off
  10. syn case ignore
  11. syn keyword CfgOnOff ON OFF YES NO TRUE FALSE contained
  12. syn match UncPath "\\\\\p*" contained
  13. "Dos Drive:\Path
  14. syn match CfgDirectory "[a-zA-Z]:\\\p*" contained
  15. "Parameters
  16. syn match CfgParams ".\{0}="me=e-1 contains=CfgComment
  17. "... and their values (don't want to highlight '=' sign)
  18. syn match CfgValues "=.*"hs=s+1 contains=CfgDirectory,UncPath,CfgComment,CfgString,CfgOnOff
  19. " Sections
  20. syn match CfgSection "\[.*\]"
  21. syn match CfgSection "{.*}"
  22. " String
  23. syn match CfgString "\".*\"" contained
  24. syn match CfgString "'.*'" contained
  25. " Comments (Everything before '#' or '//' or ';')
  26. syn match CfgComment "#.*"
  27. syn match CfgComment ";.*"
  28. syn match CfgComment "\/\/.*"
  29. " Define the default highlighting.
  30. " Only when an item doesn't have highlighting yet
  31. hi def link CfgOnOff Label
  32. hi def link CfgComment Comment
  33. hi def link CfgSection Type
  34. hi def link CfgString String
  35. hi def link CfgParams Keyword
  36. hi def link CfgValues Constant
  37. hi def link CfgDirectory Directory
  38. hi def link UncPath Directory
  39. let b:current_syntax = "cfg"
  40. " vim:ts=8