" Vim syntax file
" Language:	MSDOS batch file
" Maintainer:	Mario Eusebio <bio@dq.fct.unl.pt>
" Last change:	1997 April 25

" Remove any old syntax stuff hanging around
syntax clear

syntax case ignore

syntax keyword dosbatchStatement	call off
syntax keyword dosbatchLabel		goto in
syntax keyword dosbatchConditional	if not errorlevel exist
syntax keyword dosbatchRepeat		for do
syntax keyword dosbatchCommands		command set cls cd copy xcopy del
syntax keyword dosbatchCommands		move ren md rd path pause shift

syntax keyword dosbatchTodo contained	TODO

" String 
syntax region  dosbatchString	start=+"+  end=+"+

"syntax match  dosbatchIdentifier	"\<[a-zA-Z_][a-zA-Z0-9_]*\>"

" If you don't like tabs
"syntax match dosbatchShowTab "\t"
"syntax match dosbatchShowTabc "\t"
" syntax match  dosbatchComment		"^\ *rem.*$" contains dosbatchTodo dosbatchShowTabc

" Some people use this as a comment line
" In fact this is a Label
"syntax match  dosbatchComment		"^\ *:\ \+.*$" contains dosbatchTodo

syntax match  dosbatchComment		"^\ *rem.*$" contains dosbatchTodo
syntax match  dosbatchComment		"^\ *::.*$" contains dosbatchTodo

syntax match dosbatchLabelMark		"^\ *:[0-9a-zA-Z_\-]\+\>"

syntax match dosbatchEchoLine		"^\ *echo.*$"

syntax match dosbatchEchoStatement	"\<echo\>"
syntax match dosbatchEchoStatement	"@[a-zA-Z]\+\>"

" this is also a valid Label. I don't use it.
"syntax match dosbatchLabelMark		"^\ *:\ \+[0-9a-zA-Z_\-]\+\>"

syntax match dosbatchVariable		"%[0-9a-z_\-]%"
syntax match dosbatchArgument		"%[0-9]\>"
syntax match dosbatchArgument		"%%[a-zA-Z]\>"

syntax keyword dosbatchImplicit		append assign attrib backup break
syntax keyword dosbatchImplicit		chcp chdir cd chkdsk scandisk defrag
syntax keyword dosbatchImplicit		cls comp ctty date debug del erase
syntax keyword dosbatchImplicit		dir diskcomp diskcopy doskey dosshell
syntax keyword dosbatchImplicit		edit edlin emm386 exe2bin exit expand
syntax keyword dosbatchImplicit		fastopen fc fdisk find format graftabl
syntax keyword dosbatchImplicit		graphics help join keyb label lh
syntax keyword dosbatchImplicit		loadhigh mem mirror mkdir md mode
syntax keyword dosbatchImplicit		more nlsfunc print prompt qbasic
syntax keyword dosbatchImplicit		recover rename ren replace restore
syntax keyword dosbatchImplicit		rmdir rm setver share sort subst
syntax keyword dosbatchImplicit		sys time tree type undelete unformat
syntax keyword dosbatchImplicit		ver verify vol

if !exists("did_dosbatch_syntax_inits")
  let did_dosbatch_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  highlight link dosbatchStatement		dosbatchStatement
  highlight link dosbatchLabel			Special
  highlight link dosbatchLabelMark		Special
  highlight link dosbatchConditional		dosbatchStatement
  highlight link dosbatchRepeat			dosbatchStatement
  highlight link dosbatchCommands		dosbatchStatement
  highlight link dosbatchEchoStatement		dosbatchStatement
  highlight link dosbatchStatement		Statement
  highlight link dosbatchTodo			Todo
  highlight link dosbatchString			String
  highlight link dosbatchComment		Comment
  highlight link dosbatchArgument		Identifier
  highlight link dosbatchVariable		Identifier
  highlight link dosbatchEchoLine		String
  highlight link dosbatchImplicit		precondit

"optional highlighting
  "highlight link dosbatchShowTab		Error
  "highlight link dosbatchShowTabc		Error

  "highlight link dosbatchIdentifier		Identifier
endif
