hastepreproc.vim 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. " Vim syntax file
  2. " Language: Haste preprocessor files
  3. " Maintainer: M. Tranchero - maurizio.tranchero@gmail.com
  4. " Credits: some parts have been taken from vhdl, verilog, and C syntax
  5. " files
  6. " Version: 0.5
  7. " quit when a syntax file was already loaded
  8. if exists("b:current_syntax")
  9. finish
  10. endif
  11. " Read the haste syntax to start with
  12. runtime! syntax/haste.vim
  13. unlet b:current_syntax
  14. " case is significant
  15. syn case match
  16. " C pre-processor directives
  17. syn match hastepreprocVar display "\$[[:alnum:]_]*"
  18. syn region hastepreprocVar start="\${" end="}" contains=hastepreprocVar
  19. "
  20. "syn region hastepreproc start="#\[\s*tg[:alnum:]*" end="]#" contains=hastepreprocVar,hastepreproc,hastepreprocError,@Spell
  21. syn region hastepreproc start="#\[\s*\(\|tgfor\|tgif\)" end="$" contains=hastepreprocVar,hastepreproc,@Spell
  22. syn region hastepreproc start="}\s\(else\)\s{" end="$" contains=hastepreprocVar,hastepreproc,@Spell
  23. syn region hastepreproc start="^\s*#\s*\(ifndef\|ifdef\|else\|endif\)\>" end="$" contains=@hastepreprocGroup,@Spell
  24. syn region hastepreproc start="\s*##\s*\(define\|undef\)\>" end="$" contains=@hastepreprocGroup,@Spell
  25. syn match hastepreproc "}\{0,1}\s*]#"
  26. " Define the default highlighting.
  27. " Only when an item doesn't have highlighting yet
  28. hi def link hastepreproc Preproc
  29. hi def link hastepreprocVar Special
  30. hi def link hastepreprocError Error
  31. let b:current_syntax = "hastepreproc"
  32. " vim: ts=8