" Vim syntax file
" Language:	Vim script
" Maintainer:	Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
" Last change:	1997 April 20

" Remove any old syntax stuff hanging around
syntax clear

" regular vim stuff
syntax keyword vimCommand	ab	cmap	im	mapclear	unmap
syntax keyword vimCommand	abbreviate	cmapc	imap	nm	unmap!
syntax keyword vimCommand	abc	cmapclear	imapc	nmap	nun	vm
syntax keyword vimCommand	abclear	cno	imapclear	nmapc	nunmap	vmap
syntax keyword vimCommand	cnoremap	ino	nmapclear	vmapc
syntax keyword vimCommand	cu	inoremap	nn	so	vmapclear
syntax keyword vimCommand	cab	cunmap	iu	nnoremap	source	vn
syntax keyword vimCommand	cabbrev	iab	iunmap	no	una	vnoremap
syntax keyword vimCommand	cabc	iabbrev	map	no!	unabbreviate vu
syntax keyword vimCommand	cabclear	iabc	map!	norea	unm	vunmap
syntax keyword vimCommand	cm	iabclear	mapc	noreabbrev	unm!

syntax keyword vimSetting contained ai	equalprg	langmap	scrolljump	terse
syntax keyword vimSetting contained al	errorbells	laststatus	scrolloff	textauto
syntax keyword vimSetting contained aleph	errorfile	lazyredraw	scs	textmode
syntax keyword vimSetting contained autoindent	errorformat	lbr	sect	textwidth
syntax keyword vimSetting contained autowrite	esckeys	linebreak	sections	tf
syntax keyword vimSetting contained aw	et	lines	secure	tildeop
syntax keyword vimSetting contained backspace	ex	lisp	sh	timeout
syntax keyword vimSetting contained backup	expandtab	list	shcf	timeoutlen
syntax keyword vimSetting contained backupdir	exrc	lmap	shell	title
syntax keyword vimSetting contained backupext	fo	ls	shellcmdflag	tl
syntax keyword vimSetting contained bdir	formatoptions lz	shellpipe	tm
syntax keyword vimSetting contained bex	formatprg	magic	shellquote	to
syntax keyword vimSetting contained bin	fp	makeprg	shellredir	top
syntax keyword vimSetting contained binary	gd	maxmapdepth	shelltype	tr
syntax keyword vimSetting contained biosk	gdefault	maxmem	shiftround	ts
syntax keyword vimSetting contained bioskey	gfn	maxmemtot	shiftwidth	tsl
syntax keyword vimSetting contained bk	go	ml	shm	ttimeout
syntax keyword vimSetting contained breakat	guifont	mls	shortmess	ttimeoutlen
syntax keyword vimSetting contained brk	guioptions	mm	shortname	ttm
syntax keyword vimSetting contained bs	guipty	mmd	showbreak	tty
syntax keyword vimSetting contained ch	helpfile	mmt	showcmd	ttybuiltin
syntax keyword vimSetting contained cin	helpheight	mod	showmatch	ttyfast
syntax keyword vimSetting contained cindent	hf	modeline	showmode	ttyscroll
syntax keyword vimSetting contained cink	hh	modelines	shq	ttytype
syntax keyword vimSetting contained cinkeys	hi	modified	si	tw
syntax keyword vimSetting contained cino	hid	more	sidescroll	tx
syntax keyword vimSetting contained cinoptions	hidden	mouse	sj	uc
syntax keyword vimSetting contained cinw	mouset	sm	ul
syntax keyword vimSetting contained cinwords	history	mousetime	smartcase	undolevels
syntax keyword vimSetting contained cmdheight	hk	mp	smartindent	updatecount
syntax keyword vimSetting contained co	hkmap	nu	smarttab	updatetime
syntax keyword vimSetting contained columns	hl	number	smd	ut
syntax keyword vimSetting contained com	hls	pa	sn	vb
syntax keyword vimSetting contained comments	hlsearch	para	so	vi
syntax keyword vimSetting contained compatible	ic	paragraphs	sol	viminfo
syntax keyword vimSetting contained cp	icon	paste	sp	visualbell
syntax keyword vimSetting contained cpo	ignorecase	patchmode	splitbelow	wa
syntax keyword vimSetting contained cpoptions	im	path	sr	warn
syntax keyword vimSetting contained def	inc	pm	srr	wb
syntax keyword vimSetting contained define	include	readonly	ss	wc
syntax keyword vimSetting contained dg	incsearch	remap	st	wd
syntax keyword vimSetting contained dict	inf	report	sta	weirdinvert
syntax keyword vimSetting contained dictionary	infercase	restorescreen startofline	wh
syntax keyword vimSetting contained digraph	insertmode	revins	su	whichwrap
syntax keyword vimSetting contained dir	is	ri	suffixes	wi
syntax keyword vimSetting contained directory	isf	rightleft	sw	wildchar
syntax keyword vimSetting contained ea	isfname	rl	swapsync	winheight
syntax keyword vimSetting contained eb	isi	ro	sws	wm
syntax keyword vimSetting contained ed	isident	rs	ta	wrap
syntax keyword vimSetting contained edcompatible	isk	ru	tabstop	wrapmargin
syntax keyword vimSetting contained ef	iskeyword	ruler	tag	wrapscan
syntax keyword vimSetting contained efm	isp	sb	taglength	writeany
syntax keyword vimSetting contained ek	isprint	sbr	tagrelative	writebackup
syntax keyword vimSetting contained endofline	joinspaces	sc	tags	writedelay
syntax keyword vimSetting contained eol	js	scr	tbi	ws
syntax keyword vimSetting contained ep	keywordprg	scroll	term	ww
syntax keyword vimSetting contained equalalways	kp	softtabstop

syntax keyword vimSetting contained noai	noequalprg	nolangmap	noscrolljump	noterse
syntax keyword vimSetting contained noal	noerrorbells	nolaststatus	noscrolloff	notextauto
syntax keyword vimSetting contained noaleph	noerrorfile	nolazyredraw	noscs	notextmode
syntax keyword vimSetting contained noautoindent	noerrorformat	nolbr	nosect	notextwidth
syntax keyword vimSetting contained noautowrite	noesckeys	nolinebreak	nosections	notf
syntax keyword vimSetting contained noaw	noet	nolines	nosecure	notildeop
syntax keyword vimSetting contained nobackspace	noex	nolisp	nosh	notimeout
syntax keyword vimSetting contained nobackup	noexpandtab	nolist	noshcf	notimeoutlen
syntax keyword vimSetting contained nobackupdir	noexrc	nolmap	noshell	notitle
syntax keyword vimSetting contained nobackupext	nofo	nols	noshellcmdflag	notl
syntax keyword vimSetting contained nobdir	noformatoptions	lz	noshellpipe	notm
syntax keyword vimSetting contained nobex	noformatprg	nomagic	noshellquote	noto
syntax keyword vimSetting contained nobin	nofp	nomakeprg	noshellredir	notop
syntax keyword vimSetting contained nobinary	nogd	nomaxmapdepth	noshelltype	notr
syntax keyword vimSetting contained nobiosk	nogdefault	nomaxmem	noshiftround	nots
syntax keyword vimSetting contained nobioskey	nogfn	nomaxmemtot	noshiftwidth	notsl
syntax keyword vimSetting contained nobk	nogo	noml	noshm	nottimeout
syntax keyword vimSetting contained nobreakat	noguifont	nomls	noshortmess	nottimeoutlen
syntax keyword vimSetting contained nobrk	noguioptions	nomm	noshortname	nottm
syntax keyword vimSetting contained nobs	noguipty	nommd	noshowbreak	notty
syntax keyword vimSetting contained noch	nohelpfile	nommt	noshowcmd	nottybuiltin
syntax keyword vimSetting contained nocin	nohelpheight	nomod	noshowmatch	nottyfast
syntax keyword vimSetting contained nocindent	nohf	nomodeline	noshowmode	nottyscroll
syntax keyword vimSetting contained nocink	nohh	nomodelines	noshq	nottytype
syntax keyword vimSetting contained nocinkeys	nohi	nomodified	nosi	notw
syntax keyword vimSetting contained nocino	nohid	nomore	nosidescroll	notx
syntax keyword vimSetting contained nocinoptions	nohidden	nomouse	nosj	nouc
syntax keyword vimSetting contained nocinw	nomouset	nosm	noul
syntax keyword vimSetting contained nocinwords	nohistory	nomousetime	nosmartcase	noundolevels
syntax keyword vimSetting contained nocmdheight	nohk	nomp	nosmartindent	noupdatecount
syntax keyword vimSetting contained noco	nohkmap	nonu	nosmarttab	noupdatetime
syntax keyword vimSetting contained nocolumns	nohl	nonumber	nosmd	nout
syntax keyword vimSetting contained nocom	nohls	nopa	nosn	novb
syntax keyword vimSetting contained nocomments	nohlsearch	nopara	noso	novi
syntax keyword vimSetting contained nocompatible	noic	noparagraphs	nosol	noviminfo
syntax keyword vimSetting contained nocp	noicon	nopaste	nosp	novisualbell
syntax keyword vimSetting contained nocpo	noignorecase	nopatchmode	nosplitbelow	nowa
syntax keyword vimSetting contained nocpoptions	noim	nopath	nosr	nowarn
syntax keyword vimSetting contained nodef	noinc	nopm	nosrr	nowb
syntax keyword vimSetting contained nodefine	noinclude	noreadonly	noss	nowc
syntax keyword vimSetting contained nodg	noincsearch	noremap	nost	nowd
syntax keyword vimSetting contained nodict	noinf	noreport	nosta	noweirdinvert
syntax keyword vimSetting contained nodictionary	noinfercase	norestorescreen startofline	nowh
syntax keyword vimSetting contained nodigraph	noinsertmode	norevins	nosu	nowhichwrap
syntax keyword vimSetting contained nodir	nois	nori	nosuffixes	nowi
syntax keyword vimSetting contained nodirectory	noisf	norightleft	nosw	nowildchar
syntax keyword vimSetting contained noea	noisfname	norl	noswapsync	nowinheight
syntax keyword vimSetting contained noeb	noisi	noro	nosws	nowm
syntax keyword vimSetting contained noed	noisident	nors	nota	nowrap
syntax keyword vimSetting contained noedcompatible	noisk	noru	notabstop	nowrapmargin
syntax keyword vimSetting contained noef	noiskeyword	noruler	notag	nowrapscan
syntax keyword vimSetting contained noefm	noisp	nosb	notaglength	nowriteany
syntax keyword vimSetting contained noek	noisprint	nosbr	notagrelative	nowritebackup
syntax keyword vimSetting contained noendofline	nojoinspaces	nosc	notags	nowritedelay
syntax keyword vimSetting contained noeol	nojs	noscr	notbi	nows
syntax keyword vimSetting contained noep	nokeywordprg	noscroll	noterm	noww
syntax keyword vimSetting contained noequalalways	nokp

" termcap codes (which can also be set)
syntax keyword vimSetting contained t_AB	t_Sf	t_cm	t_md	t_ti
syntax keyword vimSetting contained t_AF	t_ZH	t_cs	t_me	t_ue
syntax keyword vimSetting contained t_AL	t_ZR	t_da	t_mr	t_us
syntax keyword vimSetting contained t_CS	t_al	t_db	t_ms	t_vb
syntax keyword vimSetting contained t_Co	t_bc	t_dl	t_se	t_ve
syntax keyword vimSetting contained t_DL	t_cd	t_ke	t_so	t_vi
syntax keyword vimSetting contained t_RI	t_ce	t_ks	t_sr	t_vs
syntax keyword vimSetting contained t_Sb	t_cl	t_mb	t_te	t_xs

" AutoBuf Events
syntax keyword vimAutoEvent contained	BufEnter	BufWrite	FileReadPost	FilterReadPost	StdinReadPre
syntax keyword vimAutoEvent contained	BufLeave	BufWritePost	FileReadPre	FilterReadPre	TermChanged
syntax keyword vimAutoEvent contained	BufNewFile	FileAPpendPost	FileWritePost	FilterWritePost	VimLeave
syntax keyword vimAutoEvent contained	BufRead	FileAPpendPre	FileWritePre	FilterWritePre	WinEnter
syntax keyword vimAutoEvent contained	BufReadPost	FileChangedShell	FileWritePre	StdinReadPost	WinLeave
syntax keyword vimAutoEvent contained	BufReadPre                 

" Highlight commonly used Groupnames
syntax keyword vimGroup	Comment	String	Constant	Character	Number	Identifier
syntax keyword vimGroup	Conditional	Repeat	Label	Statement	Float
syntax keyword vimGroup	Operator	Keyword	Function	Special	Macro
syntax keyword vimGroup	Include	Define	PreProc	PreCondit	Error	Todo
syntax keyword vimGroup	Type	StorageClass	Structure	Typedef

" Highlight syntax stuff
syntax keyword vimKeyword	syntax	keyword	match	region	link	highlight
syntax keyword vimPattern	start	skip	end
syntax keyword vimSpecial	NONE	ALLBUT	contains contained transparent oneline sync ccomment lines grouphere groupthere

" commands, function, and conditionals
syntax keyword vimCommand	let unlet ec echo echon exe execute
syntax keyword vimFunction	buffer_exists exists expand file_readable getline has highlight_exists strftime strlen substr

syntax match vimConditional	"^[: \t]*\(continue\|con\)\>"
syntax match vimConditional	"^[: \t]*\(endif\|en\)\>"
syntax match vimConditional	"^[: \t]*\(endwhile\|endw\)\>"
syntax match vimConditional	"^[: \t]*\(while\|wh\)\>"
syntax match vimConditional	"^[: \t]*break\=\>"
syntax match vimConditional	"^[: \t]*else\>"
syntax match vimConditional	"^[: \t]*elseif\=\>"
syntax match vimConditional	"^[: \t]*if\>"

" numbers
syntax match vimNumber	"-\=\<[0-9]\+.[0-9]\+\>"
syntax match vimNumber	"-\=\<[0-9]\+L\=\>"
syntax match vimNumber	"0[xX][0-9a-fA-F]\+\>"

" A comment line starts with a " at the start of the line
syntax match	vimComment	+^[ \t]*".*$+
" A comment after a command starts with a ", but skip "" and \"
syntax match	vimPartComment contained	+".*$+
syntax match	vimBackslashes contained	+\\\\+
syntax match	vimBackslashquote contained	+\\"+

" set command and associated set-options (vimSettings) with comment
syntax match vimSetLine "^[: \t]*set\=[ \t]\+.*" contains vimSetting vimSet vimNumber vimPartComment vimBackslashes vimBackslashquote
syntax match vimSet contained "set"

" autocmd
syntax keyword vimAutoSet contained set autocmd au
syntax region vimAutoCmd start=+^[ \t]*\<autocmd\>+ end="$" contains vimAutoEvent vimAutoSet vimSetting
syntax region vimAutoCmd start=+^[ \t]*\<au\>+	 end="$" contains vimAutoEvent vimAutoSet vimSetting

" Try to catch strings, else
syntax region  vimString	oneline start=+"+ skip=+\\"+ end=+"+

if !exists("did_vim_syntax_inits")
  let did_vim_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  highlight link vimConditional	vimStatement
  highlight link vimSet	vimCommand
  highlight link vimAutoSet	vimCommand

  highlight link vimAutoEvent	Type
  highlight link vimCommand	Statement
  highlight link vimComment	Comment
  highlight link vimFunction	Type
  highlight link vimGroup	Type
  highlight link vimKeyword	Statement
  highlight link vimNumber	Number
  highlight link vimPartComment	Comment
  highlight link vimPattern	Type
  highlight link vimSetting	PreProc
  highlight link vimSpecial	Type
  highlight link vimStatement	Statement
  highlight link vimString	String
endif
" vim: ts=17
