1" Vim syntax file
2" Language:    Lisp
3" Maintainer:  Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
4" Last Change: Nov 10, 2021
5" Version:     31
6" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP
7"
8"  Thanks to F Xavier Noria for a list of 978 Common Lisp symbols taken from HyperSpec
9"  Clisp additions courtesy of http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/emacs/lisp.vim
10
11" ---------------------------------------------------------------------
12"  Load Once: {{{1
13if exists("b:current_syntax")
14 finish
15endif
16
17if exists("g:lisp_isk")
18 exe "setl isk=".g:lisp_isk
19elseif (v:version == 704 && has("patch-7.4.1142")) || v:version > 704
20 syn iskeyword 38,42,43,45,47-58,60-62,64-90,97-122,_
21else
22 setl isk=38,42,43,45,47-58,60-62,64-90,97-122,_
23endif
24
25if exists("g:lispsyntax_ignorecase") || exists("g:lispsyntax_clisp")
26 set ignorecase
27endif
28
29" ---------------------------------------------------------------------
30" Clusters: {{{1
31syn cluster			lispAtomCluster		contains=lispAtomBarSymbol,lispAtomList,lispAtomNmbr0,lispComment,lispDecl,lispFunc,lispLeadWhite
32syn cluster			lispBaseListCluster	contains=lispAtom,lispAtomBarSymbol,lispAtomMark,lispBQList,lispBarSymbol,lispComment,lispConcat,lispDecl,lispFunc,lispKey,lispList,lispNumber,lispEscapeSpecial,lispSymbol,lispVar,lispLeadWhite
33if exists("g:lisp_instring")
34 syn cluster			lispListCluster		contains=@lispBaseListCluster,lispString,lispInString,lispInStringString
35else
36 syn cluster			lispListCluster		contains=@lispBaseListCluster,lispString
37endif
38
39syn case ignore
40
41" ---------------------------------------------------------------------
42" Lists: {{{1
43syn match lispSymbol	contained	![^()'`,"; \t]\+!
44syn match lispBarSymbol	contained	!|..\{-}|!
45if exists("g:lisp_rainbow") && g:lisp_rainbow != 0
46 syn region lispParen0           matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen1
47 syn region lispParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen2
48 syn region lispParen2 contained matchgroup=hlLevel2 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen3
49 syn region lispParen3 contained matchgroup=hlLevel3 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen4
50 syn region lispParen4 contained matchgroup=hlLevel4 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen5
51 syn region lispParen5 contained matchgroup=hlLevel5 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen6
52 syn region lispParen6 contained matchgroup=hlLevel6 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen7
53 syn region lispParen7 contained matchgroup=hlLevel7 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen8
54 syn region lispParen8 contained matchgroup=hlLevel8 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen9
55 syn region lispParen9 contained matchgroup=hlLevel9 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen0
56else
57 syn region lispList		matchgroup=lispParen start="("   skip="|.\{-}|"		matchgroup=lispParen end=")"	contains=@lispListCluster
58 syn region lispBQList		matchgroup=PreProc   start="`("  skip="|.\{-}|"		matchgroup=PreProc   end=")"	contains=@lispListCluster
59endif
60
61" ---------------------------------------------------------------------
62" Atoms: {{{1
63syn match lispAtomMark		"'"
64syn match lispAtom		"'("me=e-1			contains=lispAtomMark	nextgroup=lispAtomList
65syn match lispAtom		"'[^ \t()]\+"			contains=lispAtomMark
66syn match lispAtomBarSymbol	!'|..\{-}|!			contains=lispAtomMark
67syn region lispAtom		start=+'"+			skip=+\\"+ end=+"+
68syn region lispAtomList		contained			matchgroup=Special start="("	skip="|.\{-}|" matchgroup=Special end=")"	contains=@lispAtomCluster,lispString,lispEscapeSpecial
69syn match lispAtomNmbr		contained			"\<\d\+"
70syn match lispLeadWhite		contained			"^\s\+"
71
72" ---------------------------------------------------------------------
73" Standard Lisp Functions and Macros: {{{1
74syn keyword lispFunc		<				find-method				pprint-indent
75syn keyword lispFunc		<=				find-package				pprint-linear
76syn keyword lispFunc		=				find-restart				pprint-logical-block
77syn keyword lispFunc		>				find-symbol				pprint-newline
78syn keyword lispFunc		>=				finish-output				pprint-pop
79syn keyword lispFunc		-				first					pprint-tab
80syn keyword lispFunc		/				fixnum					pprint-tabular
81syn keyword lispFunc		/=				flet					prin1
82syn keyword lispFunc		//				float					prin1-to-string
83syn keyword lispFunc		///				float-digits				princ
84syn keyword lispFunc		*				floating-point-inexact			princ-to-string
85syn keyword lispFunc		**				floating-point-invalid-operation	print
86syn keyword lispFunc		***				floating-point-overflow			print-not-readable
87syn keyword lispFunc		+				floating-point-underflow		print-not-readable-object
88syn keyword lispFunc		++				floatp					print-object
89syn keyword lispFunc		+++				float-precision				print-unreadable-object
90syn keyword lispFunc		1-				float-radix				probe-file
91syn keyword lispFunc		1+				float-sign				proclaim
92syn keyword lispFunc		abort				floor					prog
93syn keyword lispFunc		abs				fmakunbound				prog*
94syn keyword lispFunc		access				force-output				prog1
95syn keyword lispFunc		acons				format					prog2
96syn keyword lispFunc		acos				formatter				progn
97syn keyword lispFunc		acosh				fourth					program-error
98syn keyword lispFunc		add-method			fresh-line				progv
99syn keyword lispFunc		adjoin				fround					provide
100syn keyword lispFunc		adjustable-array-p		ftruncate				psetf
101syn keyword lispFunc		adjust-array			ftype					psetq
102syn keyword lispFunc		allocate-instance		funcall					push
103syn keyword lispFunc		alpha-char-p			function				pushnew
104syn keyword lispFunc		alphanumericp			function-keywords			putprop
105syn keyword lispFunc		and				function-lambda-expression		quote
106syn keyword lispFunc		append				functionp				random
107syn keyword lispFunc		apply				gbitp					random-state
108syn keyword lispFunc		applyhook			gcd					random-state-p
109syn keyword lispFunc		apropos				generic-function			rassoc
110syn keyword lispFunc		apropos-list			gensym					rassoc-if
111syn keyword lispFunc		aref				gentemp					rassoc-if-not
112syn keyword lispFunc		arithmetic-error		get					ratio
113syn keyword lispFunc		arithmetic-error-operands	get-decoded-time			rational
114syn keyword lispFunc		arithmetic-error-operation	get-dispatch-macro-character		rationalize
115syn keyword lispFunc		array				getf					rationalp
116syn keyword lispFunc		array-dimension			gethash					read
117syn keyword lispFunc		array-dimension-limit		get-internal-real-time			read-byte
118syn keyword lispFunc		array-dimensions		get-internal-run-time			read-char
119syn keyword lispFunc		array-displacement		get-macro-character			read-char-no-hang
120syn keyword lispFunc		array-element-type		get-output-stream-string		read-delimited-list
121syn keyword lispFunc		array-has-fill-pointer-p	get-properties				reader-error
122syn keyword lispFunc		array-in-bounds-p		get-setf-expansion			read-eval-print
123syn keyword lispFunc		arrayp				get-setf-method				read-from-string
124syn keyword lispFunc		array-rank			get-universal-time			read-line
125syn keyword lispFunc		array-rank-limit		go					read-preserving-whitespace
126syn keyword lispFunc		array-row-major-index		graphic-char-p				read-sequence
127syn keyword lispFunc		array-total-size		handler-bind				readtable
128syn keyword lispFunc		array-total-size-limit		handler-case				readtable-case
129syn keyword lispFunc		ash				hash-table				readtablep
130syn keyword lispFunc		asin				hash-table-count			real
131syn keyword lispFunc		asinh				hash-table-p				realp
132syn keyword lispFunc		assert				hash-table-rehash-size			realpart
133syn keyword lispFunc		assoc				hash-table-rehash-threshold		reduce
134syn keyword lispFunc		assoc-if			hash-table-size				reinitialize-instance
135syn keyword lispFunc		assoc-if-not			hash-table-test				rem
136syn keyword lispFunc		atan				host-namestring				remf
137syn keyword lispFunc		atanh				identity				remhash
138syn keyword lispFunc		atom				if					remove
139syn keyword lispFunc		base-char			if-exists				remove-duplicates
140syn keyword lispFunc		base-string			ignorable				remove-if
141syn keyword lispFunc		bignum				ignore					remove-if-not
142syn keyword lispFunc		bit				ignore-errors				remove-method
143syn keyword lispFunc		bit-and				imagpart				remprop
144syn keyword lispFunc		bit-andc1			import					rename-file
145syn keyword lispFunc		bit-andc2			incf					rename-package
146syn keyword lispFunc		bit-eqv				initialize-instance			replace
147syn keyword lispFunc		bit-ior				inline					require
148syn keyword lispFunc		bit-nand			in-package				rest
149syn keyword lispFunc		bit-nor				in-package				restart
150syn keyword lispFunc		bit-not				input-stream-p				restart-bind
151syn keyword lispFunc		bit-orc1			inspect					restart-case
152syn keyword lispFunc		bit-orc2			int-char				restart-name
153syn keyword lispFunc		bit-vector			integer					return
154syn keyword lispFunc		bit-vector-p			integer-decode-float			return-from
155syn keyword lispFunc		bit-xor				integer-length				revappend
156syn keyword lispFunc		block				integerp				reverse
157syn keyword lispFunc		boole				interactive-stream-p			room
158syn keyword lispFunc		boole-1				intern					rotatef
159syn keyword lispFunc		boole-2				internal-time-units-per-second		round
160syn keyword lispFunc		boolean				intersection				row-major-aref
161syn keyword lispFunc		boole-and			invalid-method-error			rplaca
162syn keyword lispFunc		boole-andc1			invoke-debugger				rplacd
163syn keyword lispFunc		boole-andc2			invoke-restart				safety
164syn keyword lispFunc		boole-c1			invoke-restart-interactively		satisfies
165syn keyword lispFunc		boole-c2			isqrt					sbit
166syn keyword lispFunc		boole-clr			keyword					scale-float
167syn keyword lispFunc		boole-eqv			keywordp				schar
168syn keyword lispFunc		boole-ior			labels					search
169syn keyword lispFunc		boole-nand			lambda					second
170syn keyword lispFunc		boole-nor			lambda-list-keywords			sequence
171syn keyword lispFunc		boole-orc1			lambda-parameters-limit			serious-condition
172syn keyword lispFunc		boole-orc2			last					set
173syn keyword lispFunc		boole-set			lcm					set-char-bit
174syn keyword lispFunc		boole-xor			ldb					set-difference
175syn keyword lispFunc		both-case-p			ldb-test				set-dispatch-macro-character
176syn keyword lispFunc		boundp				ldiff					set-exclusive-or
177syn keyword lispFunc		break				least-negative-double-float		setf
178syn keyword lispFunc		broadcast-stream		least-negative-long-float		set-macro-character
179syn keyword lispFunc		broadcast-stream-streams	least-negative-normalized-double-float	set-pprint-dispatch
180syn keyword lispFunc		built-in-class			least-negative-normalized-long-float	setq
181syn keyword lispFunc		butlast				least-negative-normalized-short-float	set-syntax-from-char
182syn keyword lispFunc		byte				least-negative-normalized-single-float	seventh
183syn keyword lispFunc		byte-position			least-negative-short-float		shadow
184syn keyword lispFunc		byte-size			least-negative-single-float		shadowing-import
185syn keyword lispFunc		call-arguments-limit		least-positive-double-float		shared-initialize
186syn keyword lispFunc		call-method			least-positive-long-float		shiftf
187syn keyword lispFunc		call-next-method		least-positive-normalized-double-float	short-float
188syn keyword lispFunc		capitalize			least-positive-normalized-long-float	short-float-epsilon
189syn keyword lispFunc		car				least-positive-normalized-short-float	short-float-negative-epsilon
190syn keyword lispFunc		case				least-positive-normalized-single-float	short-site-name
191syn keyword lispFunc		catch				least-positive-short-float		signal
192syn keyword lispFunc		ccase				least-positive-single-float		signed-byte
193syn keyword lispFunc		cdr				length					signum
194syn keyword lispFunc		ceiling				let					simple-array
195syn keyword lispFunc		cell-error			let*					simple-base-string
196syn keyword lispFunc		cell-error-name			lisp					simple-bit-vector
197syn keyword lispFunc		cerror				lisp-implementation-type		simple-bit-vector-p
198syn keyword lispFunc		change-class			lisp-implementation-version		simple-condition
199syn keyword lispFunc		char				list					simple-condition-format-arguments
200syn keyword lispFunc		char<				list*					simple-condition-format-control
201syn keyword lispFunc		char<=				list-all-packages			simple-error
202syn keyword lispFunc		char=				listen					simple-string
203syn keyword lispFunc		char>				list-length				simple-string-p
204syn keyword lispFunc		char>=				listp					simple-type-error
205syn keyword lispFunc		char/=				load					simple-vector
206syn keyword lispFunc		character			load-logical-pathname-translations	simple-vector-p
207syn keyword lispFunc		characterp			load-time-value				simple-warning
208syn keyword lispFunc		char-bit			locally					sin
209syn keyword lispFunc		char-bits			log					single-flaot-epsilon
210syn keyword lispFunc		char-bits-limit			logand					single-float
211syn keyword lispFunc		char-code			logandc1				single-float-epsilon
212syn keyword lispFunc		char-code-limit			logandc2				single-float-negative-epsilon
213syn keyword lispFunc		char-control-bit		logbitp					sinh
214syn keyword lispFunc		char-downcase			logcount				sixth
215syn keyword lispFunc		char-equal			logeqv					sleep
216syn keyword lispFunc		char-font			logical-pathname			slot-boundp
217syn keyword lispFunc		char-font-limit			logical-pathname-translations		slot-exists-p
218syn keyword lispFunc		char-greaterp			logior					slot-makunbound
219syn keyword lispFunc		char-hyper-bit			lognand					slot-missing
220syn keyword lispFunc		char-int			lognor					slot-unbound
221syn keyword lispFunc		char-lessp			lognot					slot-value
222syn keyword lispFunc		char-meta-bit			logorc1					software-type
223syn keyword lispFunc		char-name			logorc2					software-version
224syn keyword lispFunc		char-not-equal			logtest					some
225syn keyword lispFunc		char-not-greaterp		logxor					sort
226syn keyword lispFunc		char-not-lessp			long-float				space
227syn keyword lispFunc		char-super-bit			long-float-epsilon			special
228syn keyword lispFunc		char-upcase			long-float-negative-epsilon		special-form-p
229syn keyword lispFunc		check-type			long-site-name				special-operator-p
230syn keyword lispFunc		cis				loop					speed
231syn keyword lispFunc		class				loop-finish				sqrt
232syn keyword lispFunc		class-name			lower-case-p				stable-sort
233syn keyword lispFunc		class-of			machine-instance			standard
234syn keyword lispFunc		clear-input			machine-type				standard-char
235syn keyword lispFunc		clear-output			machine-version				standard-char-p
236syn keyword lispFunc		close				macroexpand				standard-class
237syn keyword lispFunc		clrhash				macroexpand-1				standard-generic-function
238syn keyword lispFunc		code-char			macroexpand-l				standard-method
239syn keyword lispFunc		coerce				macro-function				standard-object
240syn keyword lispFunc		commonp				macrolet				step
241syn keyword lispFunc		compilation-speed		make-array				storage-condition
242syn keyword lispFunc		compile				make-array				store-value
243syn keyword lispFunc		compiled-function		make-broadcast-stream			stream
244syn keyword lispFunc		compiled-function-p		make-char				stream-element-type
245syn keyword lispFunc		compile-file			make-concatenated-stream		stream-error
246syn keyword lispFunc		compile-file-pathname		make-condition				stream-error-stream
247syn keyword lispFunc		compiler-let			make-dispatch-macro-character		stream-external-format
248syn keyword lispFunc		compiler-macro			make-echo-stream			streamp
249syn keyword lispFunc		compiler-macro-function		make-hash-table				streamup
250syn keyword lispFunc		complement			make-instance				string
251syn keyword lispFunc		complex				make-instances-obsolete			string<
252syn keyword lispFunc		complexp			make-list				string<=
253syn keyword lispFunc		compute-applicable-methods	make-load-form				string=
254syn keyword lispFunc		compute-restarts		make-load-form-saving-slots		string>
255syn keyword lispFunc		concatenate			make-method				string>=
256syn keyword lispFunc		concatenated-stream		make-package				string/=
257syn keyword lispFunc		concatenated-stream-streams	make-pathname				string-capitalize
258syn keyword lispFunc		cond				make-random-state			string-char
259syn keyword lispFunc		condition			make-sequence				string-char-p
260syn keyword lispFunc		conjugate			make-string				string-downcase
261syn keyword lispFunc		cons				make-string-input-stream		string-equal
262syn keyword lispFunc		consp				make-string-output-stream		string-greaterp
263syn keyword lispFunc		constantly			make-symbol				string-left-trim
264syn keyword lispFunc		constantp			make-synonym-stream			string-lessp
265syn keyword lispFunc		continue			make-two-way-stream			string-not-equal
266syn keyword lispFunc		control-error			makunbound				string-not-greaterp
267syn keyword lispFunc		copy-alist			map					string-not-lessp
268syn keyword lispFunc		copy-list			mapc					stringp
269syn keyword lispFunc		copy-pprint-dispatch		mapcan					string-right-strim
270syn keyword lispFunc		copy-readtable			mapcar					string-right-trim
271syn keyword lispFunc		copy-seq			mapcon					string-stream
272syn keyword lispFunc		copy-structure			maphash					string-trim
273syn keyword lispFunc		copy-symbol			map-into				string-upcase
274syn keyword lispFunc		copy-tree			mapl					structure
275syn keyword lispFunc		cos				maplist					structure-class
276syn keyword lispFunc		cosh				mask-field				structure-object
277syn keyword lispFunc		count				max					style-warning
278syn keyword lispFunc		count-if			member					sublim
279syn keyword lispFunc		count-if-not			member-if				sublis
280syn keyword lispFunc		ctypecase			member-if-not				subseq
281syn keyword lispFunc		debug				merge					subsetp
282syn keyword lispFunc		decf				merge-pathname				subst
283syn keyword lispFunc		declaim				merge-pathnames				subst-if
284syn keyword lispFunc		declaration			method					subst-if-not
285syn keyword lispFunc		declare				method-combination			substitute
286syn keyword lispFunc		decode-float			method-combination-error		substitute-if
287syn keyword lispFunc		decode-universal-time		method-qualifiers			substitute-if-not
288syn keyword lispFunc		defclass			min					subtypep
289syn keyword lispFunc		defconstant			minusp					svref
290syn keyword lispFunc		defgeneric			mismatch				sxhash
291syn keyword lispFunc		define-compiler-macro		mod					symbol
292syn keyword lispFunc		define-condition		most-negative-double-float		symbol-function
293syn keyword lispFunc		define-method-combination	most-negative-fixnum			symbol-macrolet
294syn keyword lispFunc		define-modify-macro		most-negative-long-float		symbol-name
295syn keyword lispFunc		define-setf-expander		most-negative-short-float		symbolp
296syn keyword lispFunc		define-setf-method		most-negative-single-float		symbol-package
297syn keyword lispFunc		define-symbol-macro		most-positive-double-float		symbol-plist
298syn keyword lispFunc		defmacro			most-positive-fixnum			symbol-value
299syn keyword lispFunc		defmethod			most-positive-long-float		synonym-stream
300syn keyword lispFunc		defpackage			most-positive-short-float		synonym-stream-symbol
301syn keyword lispFunc		defparameter			most-positive-single-float		sys
302syn keyword lispFunc		defsetf				muffle-warning				system
303syn keyword lispFunc		defstruct			multiple-value-bind			t
304syn keyword lispFunc		deftype				multiple-value-call			tagbody
305syn keyword lispFunc		defun				multiple-value-list			tailp
306syn keyword lispFunc		defvar				multiple-value-prog1			tan
307syn keyword lispFunc		delete				multiple-value-seteq			tanh
308syn keyword lispFunc		delete-duplicates		multiple-value-setq			tenth
309syn keyword lispFunc		delete-file			multiple-values-limit			terpri
310syn keyword lispFunc		delete-if			name-char				the
311syn keyword lispFunc		delete-if-not			namestring				third
312syn keyword lispFunc		delete-package			nbutlast				throw
313syn keyword lispFunc		denominator			nconc					time
314syn keyword lispFunc		deposit-field			next-method-p				trace
315syn keyword lispFunc		describe			nil					translate-logical-pathname
316syn keyword lispFunc		describe-object			nintersection				translate-pathname
317syn keyword lispFunc		destructuring-bind		ninth					tree-equal
318syn keyword lispFunc		digit-char			no-applicable-method			truename
319syn keyword lispFunc		digit-char-p			no-next-method				truncase
320syn keyword lispFunc		directory			not					truncate
321syn keyword lispFunc		directory-namestring		notany					two-way-stream
322syn keyword lispFunc		disassemble			notevery				two-way-stream-input-stream
323syn keyword lispFunc		division-by-zero		notinline				two-way-stream-output-stream
324syn keyword lispFunc		do				nreconc					type
325syn keyword lispFunc		do*				nreverse				typecase
326syn keyword lispFunc		do-all-symbols			nset-difference				type-error
327syn keyword lispFunc		documentation			nset-exclusive-or			type-error-datum
328syn keyword lispFunc		do-exeternal-symbols		nstring					type-error-expected-type
329syn keyword lispFunc		do-external-symbols		nstring-capitalize			type-of
330syn keyword lispFunc		dolist				nstring-downcase			typep
331syn keyword lispFunc		do-symbols			nstring-upcase				unbound-slot
332syn keyword lispFunc		dotimes				nsublis					unbound-slot-instance
333syn keyword lispFunc		double-float			nsubst					unbound-variable
334syn keyword lispFunc		double-float-epsilon		nsubst-if				undefined-function
335syn keyword lispFunc		double-float-negative-epsilon	nsubst-if-not				unexport
336syn keyword lispFunc		dpb				nsubstitute				unintern
337syn keyword lispFunc		dribble				nsubstitute-if				union
338syn keyword lispFunc		dynamic-extent			nsubstitute-if-not			unless
339syn keyword lispFunc		ecase				nth					unread
340syn keyword lispFunc		echo-stream			nthcdr					unread-char
341syn keyword lispFunc		echo-stream-input-stream	nth-value				unsigned-byte
342syn keyword lispFunc		echo-stream-output-stream	null					untrace
343syn keyword lispFunc		ed				number					unuse-package
344syn keyword lispFunc		eighth				numberp					unwind-protect
345syn keyword lispFunc		elt				numerator				update-instance-for-different-class
346syn keyword lispFunc		encode-universal-time		nunion					update-instance-for-redefined-class
347syn keyword lispFunc		end-of-file			oddp					upgraded-array-element-type
348syn keyword lispFunc		endp				open					upgraded-complex-part-type
349syn keyword lispFunc		enough-namestring		open-stream-p				upper-case-p
350syn keyword lispFunc		ensure-directories-exist	optimize				use-package
351syn keyword lispFunc		ensure-generic-function		or					user
352syn keyword lispFunc		eq				otherwise				user-homedir-pathname
353syn keyword lispFunc		eql				output-stream-p				use-value
354syn keyword lispFunc		equal				package					values
355syn keyword lispFunc		equalp				package-error				values-list
356syn keyword lispFunc		error				package-error-package			variable
357syn keyword lispFunc		etypecase			package-name				vector
358syn keyword lispFunc		eval				package-nicknames			vectorp
359syn keyword lispFunc		evalhook			packagep				vector-pop
360syn keyword lispFunc		eval-when			package-shadowing-symbols		vector-push
361syn keyword lispFunc		evenp				package-used-by-list			vector-push-extend
362syn keyword lispFunc		every				package-use-list			warn
363syn keyword lispFunc		exp				pairlis					warning
364syn keyword lispFunc		export				parse-error				when
365syn keyword lispFunc		expt				parse-integer				wild-pathname-p
366syn keyword lispFunc		extended-char			parse-namestring			with-accessors
367syn keyword lispFunc		fboundp				pathname				with-compilation-unit
368syn keyword lispFunc		fceiling			pathname-device				with-condition-restarts
369syn keyword lispFunc		fdefinition			pathname-directory			with-hash-table-iterator
370syn keyword lispFunc		ffloor				pathname-host				with-input-from-string
371syn keyword lispFunc		fifth				pathname-match-p			with-open-file
372syn keyword lispFunc		file-author			pathname-name				with-open-stream
373syn keyword lispFunc		file-error			pathnamep				with-output-to-string
374syn keyword lispFunc		file-error-pathname		pathname-type				with-package-iterator
375syn keyword lispFunc		file-length			pathname-version			with-simple-restart
376syn keyword lispFunc		file-namestring			peek-char				with-slots
377syn keyword lispFunc		file-position			phase					with-standard-io-syntax
378syn keyword lispFunc		file-stream			pi					write
379syn keyword lispFunc		file-string-length		plusp					write-byte
380syn keyword lispFunc		file-write-date			pop					write-char
381syn keyword lispFunc		fill				position				write-line
382syn keyword lispFunc		fill-pointer			position-if				write-sequence
383syn keyword lispFunc		find				position-if-not				write-string
384syn keyword lispFunc		find-all-symbols		pprint					write-to-string
385syn keyword lispFunc		find-class			pprint-dispatch				yes-or-no-p
386syn keyword lispFunc		find-if				pprint-exit-if-list-exhausted		y-or-n-p
387syn keyword lispFunc		find-if-not			pprint-fill				zerop
388
389syn match   lispFunc		"\<c[ad]\+r\>"
390if exists("g:lispsyntax_clisp")
391  " CLISP FFI:
392  syn match lispFunc	"\<\(ffi:\)\?with-c-\(place\|var\)\>"
393  syn match lispFunc	"\<\(ffi:\)\?with-foreign-\(object\|string\)\>"
394  syn match lispFunc	"\<\(ffi:\)\?default-foreign-\(language\|library\)\>"
395  syn match lispFunc	"\<\([us]_\?\)\?\(element\|deref\|cast\|slot\|validp\)\>"
396  syn match lispFunc	"\<\(ffi:\)\?set-foreign-pointer\>"
397  syn match lispFunc	"\<\(ffi:\)\?allocate-\(deep\|shallow\)\>"
398  syn match lispFunc	"\<\(ffi:\)\?c-lines\>"
399  syn match lispFunc	"\<\(ffi:\)\?foreign-\(value\|free\|variable\|function\|object\)\>"
400  syn match lispFunc	"\<\(ffi:\)\?foreign-address\(-null\|unsigned\)\?\>"
401  syn match lispFunc	"\<\(ffi:\)\?undigned-foreign-address\>"
402  syn match lispFunc	"\<\(ffi:\)\?c-var-\(address\|object\)\>"
403  syn match lispFunc	"\<\(ffi:\)\?typeof\>"
404  syn match lispFunc	"\<\(ffi:\)\?\(bit\)\?sizeof\>"
405" CLISP Macros, functions et al:
406  syn match lispFunc	"\<\(ext:\)\?with-collect\>"
407  syn match lispFunc	"\<\(ext:\)\?letf\*\?\>"
408  syn match lispFunc	"\<\(ext:\)\?finalize\>\>"
409  syn match lispFunc	"\<\(ext:\)\?memoized\>"
410  syn match lispFunc	"\<\(ext:\)\?getenv\>"
411  syn match lispFunc	"\<\(ext:\)\?convert-string-\(to\|from\)-bytes\>"
412  syn match lispFunc	"\<\(ext:\)\?ethe\>"
413  syn match lispFunc	"\<\(ext:\)\?with-gensyms\>"
414  syn match lispFunc	"\<\(ext:\)\?open-http\>"
415  syn match lispFunc	"\<\(ext:\)\?string-concat\>"
416  syn match lispFunc	"\<\(ext:\)\?with-http-\(in\|out\)put\>"
417  syn match lispFunc	"\<\(ext:\)\?with-html-output\>"
418  syn match lispFunc	"\<\(ext:\)\?expand-form\>"
419  syn match lispFunc	"\<\(ext:\)\?\(without-\)\?package-lock\>"
420  syn match lispFunc	"\<\(ext:\)\?re-export\>"
421  syn match lispFunc	"\<\(ext:\)\?saveinitmem\>"
422  syn match lispFunc	"\<\(ext:\)\?\(read\|write\)-\(integer\|float\)\>"
423  syn match lispFunc	"\<\(ext:\)\?\(read\|write\)-\(char\|byte\)-sequence\>"
424  syn match lispFunc	"\<\(custom:\)\?\*system-package-list\*\>"
425  syn match lispFunc	"\<\(custom:\)\?\*ansi\*\>"
426endif
427
428" ---------------------------------------------------------------------
429" Lisp Keywords (modifiers): {{{1
430syn keyword lispKey		:abort				:from-end			:overwrite
431syn keyword lispKey		:adjustable			:gensym				:predicate
432syn keyword lispKey		:append				:host				:preserve-whitespace
433syn keyword lispKey		:array				:if-does-not-exist		:pretty
434syn keyword lispKey		:base				:if-exists			:print
435syn keyword lispKey		:case				:include			:print-function
436syn keyword lispKey		:circle				:index				:probe
437syn keyword lispKey		:conc-name			:inherited			:radix
438syn keyword lispKey		:constructor			:initial-contents		:read-only
439syn keyword lispKey		:copier				:initial-element		:rehash-size
440syn keyword lispKey		:count				:initial-offset			:rehash-threshold
441syn keyword lispKey		:create				:initial-value			:rename
442syn keyword lispKey		:default			:input				:rename-and-delete
443syn keyword lispKey		:defaults			:internal			:size
444syn keyword lispKey		:device				:io				:start
445syn keyword lispKey		:direction			:junk-allowed			:start1
446syn keyword lispKey		:directory			:key				:start2
447syn keyword lispKey		:displaced-index-offset		:length				:stream
448syn keyword lispKey		:displaced-to			:level				:supersede
449syn keyword lispKey		:element-type			:name				:test
450syn keyword lispKey		:end				:named				:test-not
451syn keyword lispKey		:end1				:new-version			:type
452syn keyword lispKey		:end2				:nicknames			:use
453syn keyword lispKey		:error				:output				:verbose
454syn keyword lispKey		:escape				:output-file			:version
455syn keyword lispKey		:external
456" defpackage arguments
457syn keyword lispKey	:documentation	:shadowing-import-from	:modern		:export
458syn keyword lispKey	:case-sensitive	:case-inverted		:shadow		:import-from	:intern
459" lambda list keywords
460syn keyword lispKey	&allow-other-keys	&aux		&body
461syn keyword lispKey	&environment	&key			&optional	&rest		&whole
462" make-array argument
463syn keyword lispKey	:fill-pointer
464" readtable-case values
465syn keyword lispKey	:upcase		:downcase		:preserve	:invert
466" eval-when situations
467syn keyword lispKey	:load-toplevel	:compile-toplevel	:execute
468" ANSI Extended LOOP:
469syn keyword lispKey	:while      :until       :for         :do       :if          :then         :else     :when      :unless :in
470syn keyword lispKey	:across     :finally     :collect     :nconc    :maximize    :minimize     :sum
471syn keyword lispKey	:and        :with        :initially   :append   :into        :count        :end      :repeat
472syn keyword lispKey	:always     :never       :thereis     :from     :to          :upto         :downto   :below
473syn keyword lispKey	:above      :by          :on          :being    :each        :the          :hash-key :hash-keys
474syn keyword lispKey	:hash-value :hash-values :using       :of-type  :upfrom      :downfrom
475if exists("g:lispsyntax_clisp")
476  " CLISP FFI:
477  syn keyword lispKey	:arguments  :return-type :library     :full     :malloc-free
478  syn keyword lispKey	:none       :alloca      :in          :out      :in-out      :stdc-stdcall :stdc     :c
479  syn keyword lispKey	:language   :built-in    :typedef     :external
480  syn keyword lispKey	:fini       :init-once   :init-always
481endif
482
483" ---------------------------------------------------------------------
484" Standard Lisp Variables: {{{1
485syn keyword lispVar		*applyhook*			*load-pathname*			*print-pprint-dispatch*
486syn keyword lispVar		*break-on-signals*		*load-print*			*print-pprint-dispatch*
487syn keyword lispVar		*break-on-signals*		*load-truename*			*print-pretty*
488syn keyword lispVar		*break-on-warnings*		*load-verbose*			*print-radix*
489syn keyword lispVar		*compile-file-pathname*		*macroexpand-hook*		*print-readably*
490syn keyword lispVar		*compile-file-pathname*		*modules*			*print-right-margin*
491syn keyword lispVar		*compile-file-truename*		*package*			*print-right-margin*
492syn keyword lispVar		*compile-file-truename*		*print-array*			*query-io*
493syn keyword lispVar		*compile-print*			*print-base*			*random-state*
494syn keyword lispVar		*compile-verbose*		*print-case*			*read-base*
495syn keyword lispVar		*compile-verbose*		*print-circle*			*read-default-float-format*
496syn keyword lispVar		*debug-io*			*print-escape*			*read-eval*
497syn keyword lispVar		*debugger-hook*			*print-gensym*			*read-suppress*
498syn keyword lispVar		*default-pathname-defaults*	*print-length*			*readtable*
499syn keyword lispVar		*error-output*			*print-level*			*standard-input*
500syn keyword lispVar		*evalhook*			*print-lines*			*standard-output*
501syn keyword lispVar		*features*			*print-miser-width*		*terminal-io*
502syn keyword lispVar		*gensym-counter*		*print-miser-width*		*trace-output*
503
504" ---------------------------------------------------------------------
505" Strings: {{{1
506syn region			lispString			start=+"+ skip=+\\\\\|\\"+ end=+"+	contains=@Spell
507if exists("g:lisp_instring")
508 syn region			lispInString			keepend matchgroup=Delimiter start=+"(+rs=s+1 skip=+|.\{-}|+ matchgroup=Delimiter end=+)"+ contains=@lispBaseListCluster,lispInStringString
509 syn region			lispInStringString		start=+\\"+ skip=+\\\\+ end=+\\"+ contained
510endif
511
512" ---------------------------------------------------------------------
513" Shared with Xlisp, Declarations, Macros, Functions: {{{1
514syn keyword lispDecl		defmacro			do-all-symbols		labels
515syn keyword lispDecl		defsetf				do-external-symbols	let
516syn keyword lispDecl		deftype				do-symbols		locally
517syn keyword lispDecl		defun				dotimes			macrolet
518syn keyword lispDecl		do*				flet			multiple-value-bind
519if exists("g:lispsyntax_clisp")
520  " CLISP FFI:
521  syn match lispDecl	"\<\(ffi:\)\?def-c-\(var\|const\|enum\|type\|struct\)\>"
522  syn match lispDecl	"\<\(ffi:\)\?def-call-\(out\|in\)\>"
523  syn match lispDecl	"\<\(ffi:\)\?c-\(function\|struct\|pointer\|string\)\>"
524  syn match lispDecl	"\<\(ffi:\)\?c-ptr\(-null\)\?\>"
525  syn match lispDecl	"\<\(ffi:\)\?c-array\(-ptr\|-max\)\?\>"
526  syn match lispDecl	"\<\(ffi:\)\?[us]\?\(char\|short\|int\|long\)\>"
527  syn match lispDecl	"\<\(win32:\|w32\)\?d\?word\>"
528  syn match lispDecl	"\<\([us]_\?\)\?int\(8\|16\|32\|64\)\(_t\)\?\>"
529  syn keyword lispDecl	size_t off_t time_t handle
530endif
531
532" ---------------------------------------------------------------------
533" Numbers: supporting integers and floating point numbers {{{1
534syn match lispNumber		"-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([dDeEfFlL][-+]\=\d\+\)\="
535syn match lispNumber		"-\=\(\d\+/\d\+\)"
536
537syn match lispEscapeSpecial		"\*\w[a-z_0-9-]*\*"
538syn match lispEscapeSpecial		!#|[^()'`,"; \t]\+|#!
539syn match lispEscapeSpecial		!#x\x\+!
540syn match lispEscapeSpecial		!#o\o\+!
541syn match lispEscapeSpecial		!#b[01]\+!
542syn match lispEscapeSpecial		!#\\[ -}\~]!
543syn match lispEscapeSpecial		!#[':][^()'`,"; \t]\+!
544syn match lispEscapeSpecial		!#([^()'`,"; \t]\+)!
545syn match lispEscapeSpecial		!#\\\%(Space\|Newline\|Tab\|Page\|Rubout\|Linefeed\|Return\|Backspace\)!
546syn match lispEscapeSpecial		"\<+[a-zA-Z_][a-zA-Z_0-9-]*+\>"
547
548syn match lispConcat		"\s\.\s"
549syn match lispParenError	")"
550
551" ---------------------------------------------------------------------
552" Comments: {{{1
553syn cluster lispCommentGroup	contains=lispTodo,@Spell
554syn match   lispComment		";.*$"				contains=@lispCommentGroup
555syn region  lispCommentRegion	start="#|" end="|#"		contains=lispCommentRegion,@lispCommentGroup
556syn region  lispComment		start="#+nil"	end="\ze)"	contains=@lispCommentGroup
557syn match   lispComment		'^\s*#+nil.*$'			contains=@lispCommentGroup
558syn keyword lispTodo		contained			combak			combak:			todo			todo:
559
560" ---------------------------------------------------------------------
561" Synchronization: {{{1
562syn sync lines=100
563
564" ---------------------------------------------------------------------
565" Define Highlighting: {{{1
566if !exists("skip_lisp_syntax_inits")
567
568  hi def link lispCommentRegion		lispComment
569  hi def link lispAtomNmbr		lispNumber
570  hi def link lispAtomMark		lispMark
571  hi def link lispInStringString	lispString
572
573  hi def link lispAtom			Identifier
574  hi def link lispAtomBarSymbol		Special
575  hi def link lispBarSymbol		Special
576  hi def link lispComment		Comment
577  hi def link lispConcat		Statement
578  hi def link lispDecl			Statement
579  hi def link lispFunc			Statement
580  hi def link lispKey			Type
581  hi def link lispMark			Delimiter
582  hi def link lispNumber		Number
583  hi def link lispParenError		Error
584  hi def link lispEscapeSpecial		Type
585  hi def link lispString		String
586  hi def link lispTodo			Todo
587  hi def link lispVar			Statement
588
589  if exists("g:lisp_rainbow") && g:lisp_rainbow != 0
590   if &bg == "dark"
591    hi def hlLevel0 ctermfg=red		guifg=red1
592    hi def hlLevel1 ctermfg=yellow	guifg=orange1
593    hi def hlLevel2 ctermfg=green	guifg=yellow1
594    hi def hlLevel3 ctermfg=cyan	guifg=greenyellow
595    hi def hlLevel4 ctermfg=magenta	guifg=green1
596    hi def hlLevel5 ctermfg=red		guifg=springgreen1
597    hi def hlLevel6 ctermfg=yellow	guifg=cyan1
598    hi def hlLevel7 ctermfg=green	guifg=slateblue1
599    hi def hlLevel8 ctermfg=cyan	guifg=magenta1
600    hi def hlLevel9 ctermfg=magenta	guifg=purple1
601   else
602    hi def hlLevel0 ctermfg=red		guifg=red3
603    hi def hlLevel1 ctermfg=darkyellow	guifg=orangered3
604    hi def hlLevel2 ctermfg=darkgreen	guifg=orange2
605    hi def hlLevel3 ctermfg=blue	guifg=yellow3
606    hi def hlLevel4 ctermfg=darkmagenta	guifg=olivedrab4
607    hi def hlLevel5 ctermfg=red		guifg=green4
608    hi def hlLevel6 ctermfg=darkyellow	guifg=paleturquoise3
609    hi def hlLevel7 ctermfg=darkgreen	guifg=deepskyblue4
610    hi def hlLevel8 ctermfg=blue	guifg=darkslateblue
611    hi def hlLevel9 ctermfg=darkmagenta	guifg=darkviolet
612   endif
613  else
614    hi def link lispParen Delimiter
615  endif
616
617endif
618
619let b:current_syntax = "lisp"
620
621" ---------------------------------------------------------------------
622" vim: ts=8 nowrap fdm=marker
623