grads.vim 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. " Vim syntax file
  2. " Language: grads (GrADS scripts)
  3. " Maintainer: Stefan Fronzek (sfronzek at gmx dot net)
  4. " Last change: 13 Feb 2004
  5. " Grid Analysis and Display System (GrADS); http://grads.iges.org/grads
  6. " This syntax file defines highlighting for only very few features of
  7. " the GrADS scripting language.
  8. " quit when a syntax file was already loaded
  9. if exists("b:current_syntax")
  10. finish
  11. endif
  12. " GrADS is entirely case-insensitive.
  13. syn case ignore
  14. " The keywords
  15. syn keyword gradsStatement if else endif break exit return
  16. syn keyword gradsStatement while endwhile say prompt pull function
  17. syn keyword gradsStatement subwrd sublin substr read write close
  18. " String
  19. syn region gradsString start=+'+ end=+'+
  20. " Integer number
  21. syn match gradsNumber "[+-]\=\<[0-9]\+\>"
  22. " Operator
  23. "syn keyword gradsOperator | ! % & != >=
  24. "syn match gradsOperator "[^\.]not[^a-zA-Z]"
  25. " Variables
  26. syn keyword gradsFixVariables lat lon lev result rec rc
  27. syn match gradsglobalVariables "_[a-zA-Z][a-zA-Z0-9]*"
  28. syn match gradsVariables "[a-zA-Z][a-zA-Z0-9]*"
  29. syn match gradsConst "#[A-Z][A-Z_]+"
  30. " Comments
  31. syn match gradsComment "\*.*"
  32. " Typical Typos
  33. " for C programmers:
  34. " syn match gradsTypos "=="
  35. " syn match gradsTypos "!="
  36. " Define the default highlighting.
  37. " Only when an item doesn't hgs highlighting+yet
  38. hi def link gradsStatement Statement
  39. hi def link gradsString String
  40. hi def link gradsNumber Number
  41. hi def link gradsFixVariables Special
  42. hi def link gradsVariables Identifier
  43. hi def link gradsglobalVariables Special
  44. hi def link gradsConst Special
  45. hi def link gradsClassMethods Function
  46. hi def link gradsOperator Operator
  47. hi def link gradsComment Comment
  48. hi def link gradsTypos Error
  49. let b:current_syntax = "grads"