Mercurial > vim
comparison runtime/syntax/lisp.vim @ 556:f9eaf0a9872d v7.0157
updated for version 7.0157
author | vimboss |
---|---|
date | Wed, 12 Oct 2005 21:01:44 +0000 |
parents | a1059cda45f2 |
children | 862863033fdd |
comparison
equal
deleted
inserted
replaced
555:a5efb97bc104 | 556:f9eaf0a9872d |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: Lisp | 2 " Language: Lisp |
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> | 3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> |
4 " Last Change: Sep 06, 2005 | 4 " Last Change: Oct 12, 2005 |
5 " Version: 15 | 5 " Version: 16 |
6 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax | 6 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax |
7 " | 7 " |
8 " Thanks to F Xavier Noria for a list of 978 Common Lisp symbols | 8 " Thanks to F Xavier Noria for a list of 978 Common Lisp symbols |
9 " taken from the HyperSpec | 9 " taken from the HyperSpec |
10 " | 10 " |
11 " Options: | 11 " Options: |
12 " lisp_instring : if it exists, then "(...") strings are highlighted | 12 " g:lisp_instring : if it exists, then "(...") strings are highlighted |
13 " as if the contents were lisp. Useful for AutoLisp. | 13 " as if the contents were lisp. Useful for AutoLisp. |
14 " Put let lisp_instring=1 into your <.vimrc> if | 14 " Put |
15 " you want this option. | 15 " let g:lisp_instring=1 |
16 | 16 " into your <.vimrc> if you want this option. |
17 " For version 5.x: Clear all syntax items | 17 |
18 " For version 6.x: Quit when a syntax file was already loaded | 18 " Load Once: {{{1 |
19 " For vim-version 5.x: Clear all syntax items | |
20 " For vim-version 6.x: Quit when a syntax file was already loaded | |
19 if version < 600 | 21 if version < 600 |
20 syntax clear | 22 syntax clear |
21 elseif exists("b:current_syntax") | 23 elseif exists("b:current_syntax") |
22 finish | 24 finish |
23 endif | 25 endif |
26 setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ | 28 setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ |
27 else | 29 else |
28 set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ | 30 set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_ |
29 endif | 31 endif |
30 | 32 |
31 " Clusters | 33 " Clusters: {{{1 |
32 syn cluster lispAtomCluster contains=lispAtomBarSymbol,lispAtomList,lispAtomNmbr0,lispComment,lispDecl,lispFunc,lispLeadWhite | 34 syn cluster lispAtomCluster contains=lispAtomBarSymbol,lispAtomList,lispAtomNmbr0,lispComment,lispDecl,lispFunc,lispLeadWhite |
33 syn cluster lispListCluster contains=lispAtom,lispAtomBarSymbol,lispAtomMark,lispBQList,lispBarSymbol,lispComment,lispConcat,lispDecl,lispFunc,lispKey,lispList,lispNumber,lispSpecial,lispSymbol,lispVar,lispLeadWhite | 35 syn cluster lispBaseListCluster contains=lispAtom,lispAtomBarSymbol,lispAtomMark,lispBQList,lispBarSymbol,lispComment,lispConcat,lispDecl,lispFunc,lispKey,lispList,lispNumber,lispSpecial,lispSymbol,lispVar,lispLeadWhite |
34 | 36 if exists("g:lisp_instring") |
35 " Lists | 37 syn cluster lispListCluster contains=@lispBaseListCluster,lispString,lispInString,lispInStringString |
38 else | |
39 syn cluster lispListCluster contains=@lispBaseListCluster,lispString | |
40 endif | |
41 | |
42 " Lists: {{{1 | |
36 syn match lispSymbol contained ![^()'`,"; \t]\+! | 43 syn match lispSymbol contained ![^()'`,"; \t]\+! |
37 syn match lispBarSymbol contained !|..\{-}|! | 44 syn match lispBarSymbol contained !|..\{-}|! |
38 if exists("lisp_instring") | 45 if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 |
39 syn region lispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@lispListCluster,lispString,lispInString,lispInStringString | 46 syn region lispParen0 matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@lispListCluster,lispParen1 |
40 syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster,lispString,lispInString,lispInStringString | 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 | |
41 else | 56 else |
42 syn region lispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@lispListCluster,lispString | 57 syn region lispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@lispListCluster |
43 syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster,lispString | 58 syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster |
44 endif | 59 endif |
45 " Atoms | 60 |
61 " Atoms: {{{1 | |
46 syn match lispAtomMark "'" | 62 syn match lispAtomMark "'" |
47 syn match lispAtom "'("me=e-1 contains=lispAtomMark nextgroup=lispAtomList | 63 syn match lispAtom "'("me=e-1 contains=lispAtomMark nextgroup=lispAtomList |
48 syn match lispAtom "'[^ \t()]\+" contains=lispAtomMark | 64 syn match lispAtom "'[^ \t()]\+" contains=lispAtomMark |
49 syn match lispAtomBarSymbol !'|..\{-}|! contains=lispAtomMark | 65 syn match lispAtomBarSymbol !'|..\{-}|! contains=lispAtomMark |
50 syn region lispAtom start=+'"+ skip=+\\"+ end=+"+ | 66 syn region lispAtom start=+'"+ skip=+\\"+ end=+"+ |
51 syn region lispAtomList contained matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contains=@lispAtomCluster,lispString | 67 syn region lispAtomList contained matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contains=@lispAtomCluster,lispString |
52 syn match lispAtomNmbr contained "\<\d\+" | 68 syn match lispAtomNmbr contained "\<\d\+" |
53 syn match lispLeadWhite contained "^\s\+" | 69 syn match lispLeadWhite contained "^\s\+" |
54 | 70 |
55 " Standard Lisp Functions and Macros | 71 " Standard Lisp Functions and Macros: {{{1 |
56 syn keyword lispFunc * find-method pprint-indent | 72 syn keyword lispFunc * find-method pprint-indent |
57 syn keyword lispFunc ** find-package pprint-linear | 73 syn keyword lispFunc ** find-package pprint-linear |
58 syn keyword lispFunc *** find-restart pprint-logical-block | 74 syn keyword lispFunc *** find-restart pprint-logical-block |
59 syn keyword lispFunc + find-symbol pprint-newline | 75 syn keyword lispFunc + find-symbol pprint-newline |
60 syn keyword lispFunc ++ finish-output pprint-pop | 76 syn keyword lispFunc ++ finish-output pprint-pop |
368 syn keyword lispFunc find-if pprint-exit-if-list-exhausted zerop | 384 syn keyword lispFunc find-if pprint-exit-if-list-exhausted zerop |
369 syn keyword lispFunc find-if-not pprint-fill | 385 syn keyword lispFunc find-if-not pprint-fill |
370 | 386 |
371 syn match lispFunc "\<c[ad]\+r\>" | 387 syn match lispFunc "\<c[ad]\+r\>" |
372 | 388 |
373 | 389 " Lisp Keywords (modifiers): {{{1 |
374 " Lisp Keywords (modifiers) | |
375 syn keyword lispKey :abort :from-end :overwrite | 390 syn keyword lispKey :abort :from-end :overwrite |
376 syn keyword lispKey :adjustable :gensym :predicate | 391 syn keyword lispKey :adjustable :gensym :predicate |
377 syn keyword lispKey :append :host :preserve-whitespace | 392 syn keyword lispKey :append :host :preserve-whitespace |
378 syn keyword lispKey :array :if-does-not-exist :pretty | 393 syn keyword lispKey :array :if-does-not-exist :pretty |
379 syn keyword lispKey :base :if-exists :print | 394 syn keyword lispKey :base :if-exists :print |
397 syn keyword lispKey :end2 :nicknames :use | 412 syn keyword lispKey :end2 :nicknames :use |
398 syn keyword lispKey :error :output :verbose | 413 syn keyword lispKey :error :output :verbose |
399 syn keyword lispKey :escape :output-file :version | 414 syn keyword lispKey :escape :output-file :version |
400 syn keyword lispKey :external | 415 syn keyword lispKey :external |
401 | 416 |
402 " Standard Lisp Variables | 417 " Standard Lisp Variables: {{{1 |
403 syn keyword lispVar *applyhook* *load-pathname* *print-pprint-dispatch* | 418 syn keyword lispVar *applyhook* *load-pathname* *print-pprint-dispatch* |
404 syn keyword lispVar *break-on-signals* *load-print* *print-pprint-dispatch* | 419 syn keyword lispVar *break-on-signals* *load-print* *print-pprint-dispatch* |
405 syn keyword lispVar *break-on-signals* *load-truename* *print-pretty* | 420 syn keyword lispVar *break-on-signals* *load-truename* *print-pretty* |
406 syn keyword lispVar *break-on-warnings* *load-verbose* *print-radix* | 421 syn keyword lispVar *break-on-warnings* *load-verbose* *print-radix* |
407 syn keyword lispVar *compile-file-pathname* *macroexpand-hook* *print-readably* | 422 syn keyword lispVar *compile-file-pathname* *macroexpand-hook* *print-readably* |
417 syn keyword lispVar *error-output* *print-level* *standard-input* | 432 syn keyword lispVar *error-output* *print-level* *standard-input* |
418 syn keyword lispVar *evalhook* *print-lines* *standard-output* | 433 syn keyword lispVar *evalhook* *print-lines* *standard-output* |
419 syn keyword lispVar *features* *print-miser-width* *terminal-io* | 434 syn keyword lispVar *features* *print-miser-width* *terminal-io* |
420 syn keyword lispVar *gensym-counter* *print-miser-width* *trace-output* | 435 syn keyword lispVar *gensym-counter* *print-miser-width* *trace-output* |
421 | 436 |
422 " Strings | 437 " Strings: {{{1 |
423 syn region lispString start=+"+ skip=+\\\\\|\\"+ end=+"+ | 438 syn region lispString start=+"+ skip=+\\\\\|\\"+ end=+"+ |
424 if exists("lisp_instring") | 439 if exists("g:lisp_instring") |
425 syn region lispInString keepend matchgroup=Delimiter start=+"(+rs=s+1 skip=+|.\{-}|+ matchgroup=Delimiter end=+)"+ contains=@lispListCluster,lispInStringString | 440 syn region lispInString keepend matchgroup=Delimiter start=+"(+rs=s+1 skip=+|.\{-}|+ matchgroup=Delimiter end=+)"+ contains=@lispBaseListCluster,lispInStringString |
426 syn region lispInStringString start=+\\"+ skip=+\\\\+ end=+\\"+ contained | 441 syn region lispInStringString start=+\\"+ skip=+\\\\+ end=+\\"+ contained |
427 endif | 442 endif |
428 | 443 |
429 " Shared with Xlisp, Declarations, Macros, Functions | 444 " Shared with Xlisp, Declarations, Macros, Functions: {{{1 |
430 syn keyword lispDecl defmacro do-all-symbols labels | 445 syn keyword lispDecl defmacro do-all-symbols labels |
431 syn keyword lispDecl defsetf do-external-symbols let | 446 syn keyword lispDecl defsetf do-external-symbols let |
432 syn keyword lispDecl deftype do-symbols locally | 447 syn keyword lispDecl deftype do-symbols locally |
433 syn keyword lispDecl defun dotimes macrolet | 448 syn keyword lispDecl defun dotimes macrolet |
434 syn keyword lispDecl do* flet multiple-value-bind | 449 syn keyword lispDecl do* flet multiple-value-bind |
435 | 450 |
436 " Numbers: supporting integers and floating point numbers | 451 " Numbers: supporting integers and floating point numbers {{{1 |
437 syn match lispNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\(e[-+]\=\d\+\)\=" | 452 syn match lispNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\(e[-+]\=\d\+\)\=" |
438 | 453 |
439 syn match lispSpecial "\*[a-zA-Z_][a-zA-Z_0-9-]*\*" | 454 syn match lispSpecial "\*[a-zA-Z_][a-zA-Z_0-9-]*\*" |
440 syn match lispSpecial !#|[^()'`,"; \t]\+|#! | 455 syn match lispSpecial !#|[^()'`,"; \t]\+|#! |
441 syn match lispSpecial !#x[0-9a-fA-F]\+! | 456 syn match lispSpecial !#x[0-9a-fA-F]\+! |
446 syn match lispSpecial !#([^()'`,"; \t]\+)! | 461 syn match lispSpecial !#([^()'`,"; \t]\+)! |
447 | 462 |
448 syn match lispConcat "\s\.\s" | 463 syn match lispConcat "\s\.\s" |
449 syn match lispParenError ")" | 464 syn match lispParenError ")" |
450 | 465 |
451 " Comments | 466 " Comments: {{{1 |
452 syn cluster lispCommentGroup contains=lispTodo,@Spell | 467 syn cluster lispCommentGroup contains=lispTodo,@Spell |
453 syn match lispComment ";.*$" contains=@lispCommentGroup | 468 syn match lispComment ";.*$" contains=@lispCommentGroup |
454 syn region lispCommentRegion start="#|" end="|#" contains=lispCommentRegion,@lispCommentGroup | 469 syn region lispCommentRegion start="#|" end="|#" contains=lispCommentRegion,@lispCommentGroup |
455 syn case ignore | 470 syn case ignore |
456 syn keyword lispTodo contained combak combak: todo todo: | 471 syn keyword lispTodo contained combak combak: todo todo: |
457 syn case match | 472 syn case match |
458 | 473 |
459 " synchronization | 474 " Synchronization: {{{1 |
460 syn sync lines=100 | 475 syn sync lines=100 |
461 | 476 |
462 " Define the default highlighting. | 477 " Define Highlighting: {{{1 |
463 " For version 5.7 and earlier: only when not done already | 478 " For version 5.7 and earlier: only when not done already |
464 " For version 5.8 and later: only when an item doesn't have highlighting yet | 479 " For version 5.8 and later: only when an item doesn't have highlighting yet |
465 if version >= 508 || !exists("did_lisp_syntax_inits") | 480 if version >= 508 || !exists("did_lisp_syntax_inits") |
466 if version < 508 | 481 if version < 508 |
467 let did_lisp_syntax_inits = 1 | 482 let did_lisp_syntax_inits = 1 |
489 HiLink lispSpecial Type | 504 HiLink lispSpecial Type |
490 HiLink lispString String | 505 HiLink lispString String |
491 HiLink lispTodo Todo | 506 HiLink lispTodo Todo |
492 HiLink lispVar Statement | 507 HiLink lispVar Statement |
493 | 508 |
509 if exists("g:lisp_rainbow") && g:lisp_rainbow != 0 | |
510 if &bg == "dark" | |
511 hi hlLevel0 ctermfg=red guifg=red1 | |
512 hi hlLevel1 ctermfg=yellow guifg=orange1 | |
513 hi hlLevel2 ctermfg=green guifg=yellow1 | |
514 hi hlLevel3 ctermfg=cyan guifg=greenyellow | |
515 hi hlLevel4 ctermfg=magenta guifg=green1 | |
516 hi hlLevel5 ctermfg=red guifg=springgreen1 | |
517 hi hlLevel6 ctermfg=yellow guifg=cyan1 | |
518 hi hlLevel7 ctermfg=green guifg=slateblue1 | |
519 hi hlLevel8 ctermfg=cyan guifg=magenta1 | |
520 hi hlLevel9 ctermfg=magenta guifg=purple1 | |
521 else | |
522 hi hlLevel0 ctermfg=red guifg=red3 | |
523 hi hlLevel1 ctermfg=darkyellow guifg=orangered3 | |
524 hi hlLevel2 ctermfg=darkgreen guifg=orange2 | |
525 hi hlLevel3 ctermfg=blue guifg=yellow3 | |
526 hi hlLevel4 ctermfg=darkmagenta guifg=olivedrab4 | |
527 hi hlLevel5 ctermfg=red guifg=green4 | |
528 hi hlLevel6 ctermfg=darkyellow guifg=paleturquoise3 | |
529 hi hlLevel7 ctermfg=darkgreen guifg=deepskyblue4 | |
530 hi hlLevel8 ctermfg=blue guifg=darkslateblue | |
531 hi hlLevel9 ctermfg=darkmagenta guifg=darkviolet | |
532 endif | |
533 endif | |
534 | |
494 delcommand HiLink | 535 delcommand HiLink |
495 endif | 536 endif |
496 | 537 |
497 let b:current_syntax = "lisp" | 538 let b:current_syntax = "lisp" |
498 | 539 |
499 " vim: ts=8 nowrap | 540 " vim: ts=8 nowrap fdm=marker |