home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / lite.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  4.9 KB  |  160 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    lite
  3. " Maintainer:    Lutz Eymers <ixtab@polzin.com>
  4. " URL:        http://www-public.rz.uni-duesseldorf.de/~eymers/vim/syntax
  5. " Email:        Subject: send syntax_vim.tgz
  6. " Last change:    1999 Jun 14
  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.  
  11. " Remove any old syntax stuff hanging around
  12. syn clear
  13.  
  14. if !exists("main_syntax")
  15.   let main_syntax = 'lite'
  16. endif
  17.  
  18. if main_syntax == 'lite'
  19.   if exists("lite_sql_query")
  20.     if lite_sql_query == 1
  21.       syn include @liteSql <sfile>:p:h/sql.vim
  22.     endif
  23.   endif
  24. endif
  25.  
  26. if (main_syntax == 'msql')
  27.   if exists("msql_sql_query")
  28.     if msql_sql_query == 1
  29.       syn include @liteSql <sfile>:p:h/sql.vim
  30.     endif
  31.   endif
  32. endif
  33.  
  34. syn cluster liteSql remove=sqlString,sqlComment
  35.  
  36. syn case match
  37.  
  38. " Internal Variables
  39. syn keyword liteIntVar ERRMSG contained
  40.  
  41. " Comment
  42. syn region liteComment        start="/\*" end="\*/" contains=liteTodo
  43.  
  44. " Function names
  45. syn keyword liteFunctions  echo printf fprintf open close read
  46. syn keyword liteFunctions  readln readtok
  47. syn keyword liteFunctions  split strseg chop tr sub substr
  48. syn keyword liteFunctions  test unlink umask chmod mkdir chdir rmdir
  49. syn keyword liteFunctions  rename truncate link symlink stat
  50. syn keyword liteFunctions  sleep system getpid getpidd kill
  51. syn keyword liteFunctions  time ctime time2unixtime unixtime2year
  52. syn keyword liteFunctions  unixtime2year unixtime2month unixtime2day
  53. syn keyword liteFunctions  unixtime2hour unixtime2min unixtime2sec
  54. syn keyword liteFunctions  strftime
  55. syn keyword liteFunctions  getpwnam getpwuid
  56. syn keyword liteFunctions  gethostbyname gethostbyaddress
  57. syn keyword liteFunctions  urlEncode setContentType includeFile
  58. syn keyword liteFunctions  msqlConnect msqlClose msqlSelectDB
  59. syn keyword liteFunctions  msqlQuery msqlStoreResult msqlFreeResult
  60. syn keyword liteFunctions  msqlFetchRow msqlDataSeek msqlListDBs
  61. syn keyword liteFunctions  msqlListTables msqlInitFieldList msqlListField
  62. syn keyword liteFunctions  msqlFieldSeek msqlNumRows msqlEncode
  63. syn keyword liteFunctions  exit fatal typeof
  64.  
  65. " Identifier
  66. syn match  liteIdentifier "$[a-zA-Z_][a-zA-Z0-9_]*" contains=liteIntVar
  67. syn match  liteGlobalIdentifier "@[a-zA-Z_][a-zA-Z0-9_]*" contains=liteIntVar
  68.  
  69. " Conditional
  70. syn keyword liteConditional  if else
  71.  
  72. " Repeat
  73. syn keyword liteRepeat  while
  74.  
  75. " Operator
  76. syn keyword liteStatement  break return continue
  77.  
  78. " Operator
  79. syn match liteOperator  "[-+=#*]"
  80. syn match liteOperator  "/[^*]"me=e-1
  81. syn match liteOperator  "/$"
  82. syn match liteRelation  "&&"
  83. syn match liteRelation  "||"
  84. syn match liteRelation  "[!=<>]="
  85. syn match liteRelation  "[<>]"
  86.  
  87. " Include
  88. syn keyword liteInclude  load
  89.  
  90. " Define
  91. syn keyword liteDefine  funct
  92.  
  93. " Type
  94. syn keyword liteType  int uint char real
  95.  
  96. " String
  97. syn region liteString  keepend matchgroup=None start=+"+  skip=+\\\\\|\\"+  end=+"+ contains=liteIdentifier,liteSpecialChar,@liteSql
  98.  
  99. " Number
  100. syn match liteNumber  "-\=\<\d\+\>"
  101.  
  102. " Float
  103. syn match liteFloat  "\(-\=\<\d+\|-\=\)\.\d\+\>"
  104.  
  105. " SpecialChar
  106. syn match liteSpecialChar "\\[abcfnrtv\\]" contained
  107.  
  108. syn match liteParentError "[)}\]]"
  109.  
  110. " Todo
  111. syn keyword liteTodo TODO Todo todo contained
  112.  
  113. " dont syn #!...
  114. syn match liteExec "^#!.*$"
  115.  
  116. " Parents
  117. syn cluster liteInside contains=liteComment,liteFunctions,liteIdentifier,liteGlobalIdentifier,liteConditional,liteRepeat,liteStatement,liteOperator,liteRelation,liteType,liteString,liteNumber,liteFloat,liteParent
  118.  
  119. syn region liteParent matchgroup=Delimiter start="(" end=")" contains=@liteInside
  120. syn region liteParent matchgroup=Delimiter start="{" end="}" contains=@liteInside
  121. syn region liteParent matchgroup=Delimiter start="\[" end="\]" contains=@liteInside
  122.  
  123. " sync
  124. if exists("lite_minlines")
  125.   exec "syn sync minlines=" . lite_minlines
  126. endif
  127.  
  128. if !exists("did_lite_syntax_inits")
  129.   let did_lite_syntax_inits = 1
  130.   " The default methods for highlighting.  Can be overridden later
  131.   hi link liteComment                   Comment
  132.   hi link liteString                    String
  133.   hi link liteNumber                    Number
  134.   hi link liteFloat                     Float
  135.   hi liteIdentifier guifg=DarkGrey ctermfg=Brown
  136.   hi liteGlobalIdentifier guifg=DarkGrey ctermfg=Brown
  137.   hi link liteFunctions                 Function
  138.   hi link liteRepeat                    Repeat
  139.   hi link liteConditional               Conditional
  140.   hi link liteStatement                 Statement
  141.   hi link liteType                      Type
  142.   hi link liteInclude                   Include
  143.   hi link liteDefine                    Define
  144.   hi link liteSpecialChar               SpecialChar
  145.   hi link liteParentError            liteError
  146.   hi link liteError                    Error
  147.   hi link liteTodo                      Todo
  148.   hi liteRelation guifg=SeaGreen ctermfg=DarkGreen
  149.   hi liteOperator guifg=SeaGreen ctermfg=DarkGreen
  150.   hi liteIntVar guifg=Red ctermfg=DarkRed
  151. endif
  152.  
  153. let b:current_syntax = "lite"
  154.  
  155. if main_syntax == 'lite'
  156.   unlet main_syntax
  157. endif
  158.  
  159. " vim: ts=8
  160.