lite.vim 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. " Vim syntax file
  2. " Language: lite
  3. " Maintainer: Lutz Eymers <ixtab@polzin.com>
  4. " URL: http://www.isp.de/data/lite.vim
  5. " Email: Subject: send syntax_vim.tgz
  6. " Last Change: 2001 Mai 01
  7. "
  8. " Options lite_sql_query = 1 for SQL syntax highligthing inside strings
  9. " lite_minlines = x to sync at least x lines backwards
  10. " quit when a syntax file was already loaded
  11. if exists("b:current_syntax")
  12. finish
  13. endif
  14. if !exists("main_syntax")
  15. let main_syntax = 'lite'
  16. endif
  17. if main_syntax == 'lite'
  18. if exists("lite_sql_query")
  19. if lite_sql_query == 1
  20. syn include @liteSql <sfile>:p:h/sql.vim
  21. unlet b:current_syntax
  22. endif
  23. endif
  24. endif
  25. if main_syntax == 'msql'
  26. if exists("msql_sql_query")
  27. if msql_sql_query == 1
  28. syn include @liteSql <sfile>:p:h/sql.vim
  29. unlet b:current_syntax
  30. endif
  31. endif
  32. endif
  33. syn cluster liteSql remove=sqlString,sqlComment
  34. syn case match
  35. " Internal Variables
  36. syn keyword liteIntVar ERRMSG contained
  37. " Comment
  38. syn region liteComment start="/\*" end="\*/" contains=liteTodo
  39. " Function names
  40. syn keyword liteFunctions echo printf fprintf open close read
  41. syn keyword liteFunctions readln readtok
  42. syn keyword liteFunctions split strseg chop tr sub substr
  43. syn keyword liteFunctions test unlink umask chmod mkdir chdir rmdir
  44. syn keyword liteFunctions rename truncate link symlink stat
  45. syn keyword liteFunctions sleep system getpid getppid kill
  46. syn keyword liteFunctions time ctime time2unixtime unixtime2year
  47. syn keyword liteFunctions unixtime2year unixtime2month unixtime2day
  48. syn keyword liteFunctions unixtime2hour unixtime2min unixtime2sec
  49. syn keyword liteFunctions strftime
  50. syn keyword liteFunctions getpwnam getpwuid
  51. syn keyword liteFunctions gethostbyname gethostbyaddress
  52. syn keyword liteFunctions urlEncode setContentType includeFile
  53. syn keyword liteFunctions msqlConnect msqlClose msqlSelectDB
  54. syn keyword liteFunctions msqlQuery msqlStoreResult msqlFreeResult
  55. syn keyword liteFunctions msqlFetchRow msqlDataSeek msqlListDBs
  56. syn keyword liteFunctions msqlListTables msqlInitFieldList msqlListField
  57. syn keyword liteFunctions msqlFieldSeek msqlNumRows msqlEncode
  58. syn keyword liteFunctions exit fatal typeof
  59. syn keyword liteFunctions crypt addHttpHeader
  60. " Conditional
  61. syn keyword liteConditional if else
  62. " Repeat
  63. syn keyword liteRepeat while
  64. " Operator
  65. syn keyword liteStatement break return continue
  66. " Operator
  67. syn match liteOperator "[-+=#*]"
  68. syn match liteOperator "/[^*]"me=e-1
  69. syn match liteOperator "\$"
  70. syn match liteRelation "&&"
  71. syn match liteRelation "||"
  72. syn match liteRelation "[!=<>]="
  73. syn match liteRelation "[<>]"
  74. " Identifier
  75. syn match liteIdentifier "$\h\w*" contains=liteIntVar,liteOperator
  76. syn match liteGlobalIdentifier "@\h\w*" contains=liteIntVar
  77. " Include
  78. syn keyword liteInclude load
  79. " Define
  80. syn keyword liteDefine funct
  81. " Type
  82. syn keyword liteType int uint char real
  83. " String
  84. syn region liteString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=liteIdentifier,liteSpecialChar,@liteSql
  85. " Number
  86. syn match liteNumber "-\=\<\d\+\>"
  87. " Float
  88. syn match liteFloat "\(-\=\<\d+\|-\=\)\.\d\+\>"
  89. " SpecialChar
  90. syn match liteSpecialChar "\\[abcfnrtv\\]" contained
  91. syn match liteParentError "[)}\]]"
  92. " Todo
  93. syn keyword liteTodo TODO Todo todo contained
  94. " dont syn #!...
  95. syn match liteExec "^#!.*$"
  96. " Parents
  97. syn cluster liteInside contains=liteComment,liteFunctions,liteIdentifier,liteGlobalIdentifier,liteConditional,liteRepeat,liteStatement,liteOperator,liteRelation,liteType,liteString,liteNumber,liteFloat,liteParent
  98. syn region liteParent matchgroup=Delimiter start="(" end=")" contains=@liteInside
  99. syn region liteParent matchgroup=Delimiter start="{" end="}" contains=@liteInside
  100. syn region liteParent matchgroup=Delimiter start="\[" end="\]" contains=@liteInside
  101. " sync
  102. if main_syntax == 'lite'
  103. if exists("lite_minlines")
  104. exec "syn sync minlines=" . lite_minlines
  105. else
  106. syn sync minlines=100
  107. endif
  108. endif
  109. " Define the default highlighting.
  110. " Only when an item doesn't have highlighting yet
  111. hi def link liteComment Comment
  112. hi def link liteString String
  113. hi def link liteNumber Number
  114. hi def link liteFloat Float
  115. hi def link liteIdentifier Identifier
  116. hi def link liteGlobalIdentifier Identifier
  117. hi def link liteIntVar Identifier
  118. hi def link liteFunctions Function
  119. hi def link liteRepeat Repeat
  120. hi def link liteConditional Conditional
  121. hi def link liteStatement Statement
  122. hi def link liteType Type
  123. hi def link liteInclude Include
  124. hi def link liteDefine Define
  125. hi def link liteSpecialChar SpecialChar
  126. hi def link liteParentError liteError
  127. hi def link liteError Error
  128. hi def link liteTodo Todo
  129. hi def link liteOperator Operator
  130. hi def link liteRelation Operator
  131. let b:current_syntax = "lite"
  132. if main_syntax == 'lite'
  133. unlet main_syntax
  134. endif
  135. " vim: ts=8