chatito.vim 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. " Vim syntax file
  2. " Language: Chatito
  3. " Maintainer: ObserverOfTime <chronobserver@disroot.org>
  4. " Filenames: *.chatito
  5. " Last Change: 2022 Sep 19
  6. if exists('b:current_syntax')
  7. finish
  8. endif
  9. " Comment
  10. syn keyword chatitoTodo contained TODO FIXME XXX
  11. syn match chatitoComment /^#.*/ contains=chatitoTodo,@Spell
  12. syn match chatitoComment +^//.*+ contains=chatitoTodo,@Spell
  13. " Import
  14. syn match chatitoImport /^import \+.*$/ transparent contains=chatitoImportKeyword,chatitoImportFile
  15. syn keyword chatitoImportKeyword import contained nextgroup=chatitoImportFile
  16. syn match chatitoImportFile /.*$/ contained skipwhite
  17. " Intent
  18. syn match chatitoIntent /^%\[[^\]?]\+\]\((.\+)\)\=$/ contains=chatitoArgs
  19. " Slot
  20. syn match chatitoSlot /^@\[[^\]?#]\+\(#[^\]?#]\+\)\=\]\((.\+)\)\=$/ contains=chatitoArgs,chatitoVariation
  21. syn match chatitoSlot /@\[[^\]?#]\+\(#[^\]?#]\+\)\=?\=\]/ contained contains=chatitoOpt,chatitoVariation
  22. " Alias
  23. syn match chatitoAlias /^\~\[[^\]?]\+\]\=$/
  24. syn match chatitoAlias /\~\[[^\]?]\+?\=\]/ contained contains=chatitoOpt
  25. " Probability
  26. syn match chatitoProbability /\*\[\d\+\(\.\d\+\)\=%\=\]/ contained
  27. " Optional
  28. syn match chatitoOpt '?' contained
  29. " Arguments
  30. syn match chatitoArgs /(.\+)/ contained
  31. " Variation
  32. syn match chatitoVariation /#[^\]?#]\+/ contained
  33. " Value
  34. syn match chatitoValue /^ \{4\}\zs.\+$/ contains=chatitoProbability,chatitoSlot,chatitoAlias,@Spell
  35. " Errors
  36. syn match chatitoError /^\t/
  37. hi def link chatitoAlias String
  38. hi def link chatitoArgs Special
  39. hi def link chatitoComment Comment
  40. hi def link chatitoError Error
  41. hi def link chatitoImportKeyword Include
  42. hi def link chatitoIntent Statement
  43. hi def link chatitoOpt SpecialChar
  44. hi def link chatitoProbability Number
  45. hi def link chatitoSlot Identifier
  46. hi def link chatitoTodo Todo
  47. hi def link chatitoVariation Special
  48. let b:current_syntax = 'chatito'