home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / dosbatch.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  3.2 KB  |  94 lines

  1. " Vim syntax file
  2. " Language:    MSDOS batch file
  3. " Maintainer:    Mario Eusebio <bio@dq.fct.unl.pt>
  4. " Last change:    1997 April 25
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. syn case ignore
  10.  
  11. syn keyword dosbatchStatement    call off
  12. syn keyword dosbatchLabel        goto in
  13. syn keyword dosbatchConditional    if not errorlevel exist
  14. syn keyword dosbatchRepeat        for do
  15. syn keyword dosbatchCommands        command set cls cd copy xcopy del
  16. syn keyword dosbatchCommands        move ren md rd path pause shift
  17.  
  18. syn keyword dosbatchTodo contained    TODO
  19.  
  20. " String
  21. syn region  dosbatchString    start=+"+  end=+"+
  22.  
  23. "syn match  dosbatchIdentifier    "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
  24.  
  25. " If you don't like tabs
  26. "syn match dosbatchShowTab "\t"
  27. "syn match dosbatchShowTabc "\t"
  28. "syn match  dosbatchComment        "^\ *rem.*$" contains=dosbatchTodo,dosbatchShowTabc
  29.  
  30. " Some people use this as a comment line
  31. " In fact this is a Label
  32. "syn match  dosbatchComment        "^\ *:\ \+.*$" contains=dosbatchTodo
  33.  
  34. syn match  dosbatchComment        "^\ *rem.*$" contains=dosbatchTodo
  35. syn match  dosbatchComment        "^\ *::.*$" contains=dosbatchTodo
  36.  
  37. syn match dosbatchLabelMark        "^\ *:[0-9a-zA-Z_\-]\+\>"
  38.  
  39. syn match dosbatchEchoLine        "^\ *echo.*$"
  40.  
  41. syn match dosbatchEchoStatement    "\<echo\>"
  42. syn match dosbatchEchoStatement    "@[a-zA-Z]\+\>"
  43.  
  44. " this is also a valid Label. I don't use it.
  45. "syn match dosbatchLabelMark        "^\ *:\ \+[0-9a-zA-Z_\-]\+\>"
  46.  
  47. syn match dosbatchVariable        "%[0-9a-z_\-]%"
  48. syn match dosbatchArgument        "%\d\>"
  49. syn match dosbatchArgument        "%%[a-zA-Z]\>"
  50.  
  51. syn keyword dosbatchImplicit        append assign attrib backup break
  52. syn keyword dosbatchImplicit        chcp chdir cd chkdsk scandisk defrag
  53. syn keyword dosbatchImplicit        cls comp ctty date debug del erase
  54. syn keyword dosbatchImplicit        dir diskcomp diskcopy doskey dosshell
  55. syn keyword dosbatchImplicit        edit edlin emm386 exe2bin exit expand
  56. syn keyword dosbatchImplicit        fastopen fc fdisk find format graftabl
  57. syn keyword dosbatchImplicit        graphics help join keyb label lh
  58. syn keyword dosbatchImplicit        loadhigh mem mirror mkdir md mode
  59. syn keyword dosbatchImplicit        more nlsfunc print prompt qbasic
  60. syn keyword dosbatchImplicit        recover rename ren replace restore
  61. syn keyword dosbatchImplicit        rmdir rm setver share sort subst
  62. syn keyword dosbatchImplicit        sys time tree type undelete unformat
  63. syn keyword dosbatchImplicit        ver verify vol
  64.  
  65. if !exists("did_dosbatch_syntax_inits")
  66.   let did_dosbatch_syntax_inits = 1
  67.   " The default methods for highlighting.  Can be overridden later
  68.   hi link dosbatchStatement        dosbatchStatement
  69.   hi link dosbatchLabel            Special
  70.   hi link dosbatchLabelMark        Special
  71.   hi link dosbatchConditional        dosbatchStatement
  72.   hi link dosbatchRepeat            dosbatchStatement
  73.   hi link dosbatchCommands        dosbatchStatement
  74.   hi link dosbatchEchoStatement        dosbatchStatement
  75.   hi link dosbatchStatement        Statement
  76.   hi link dosbatchTodo            Todo
  77.   hi link dosbatchString            String
  78.   hi link dosbatchComment        Comment
  79.   hi link dosbatchArgument        Identifier
  80.   hi link dosbatchVariable        Identifier
  81.   hi link dosbatchEchoLine        String
  82.   hi link dosbatchImplicit        precondit
  83.  
  84. "optional highlighting
  85.   "hi link dosbatchShowTab        Error
  86.   "hi link dosbatchShowTabc        Error
  87.  
  88.   "hi link dosbatchIdentifier        Identifier
  89. endif
  90.  
  91. let b:current_syntax = "dosbatch"
  92.  
  93. " vim: ts=8
  94.