home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / lisp.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  14.5 KB  |  260 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language   :    Lisp
  3. " Maintainer :    Dr. Charles E. Campbell, Jr. <Charles.Campbell@gsfc.nasa.gov>
  4. " Last Change:    July 13, 1999
  5. " Version    :    1.03
  6.  
  7. " remove any old syntax stuff hanging around
  8. syn clear
  9. set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
  10.  
  11. " Clusters
  12. syn cluster    lispAtomCluster    contains=lispAtomBarSymbol,lispAtomList,lispAtomNmbr0,lispComment,lispString
  13. syn cluster    lispListCluster    contains=lispAtom,lispAtomBarSymbol,lispAtomMark,lispBQList,lispBarSymbol,lispComment,lispConcat,lispDecl,lispFunc,lispKey,lispList,lispNumber,lispSpecial,lispString,lispSymbol,lispVar
  14.  
  15. " Lists
  16. syn match    lispSymbol    contained    ![^()'`,"; \t]\+!
  17. syn match    lispBarSymbol    contained    !|..\{-}|!
  18. syn region    lispList    matchgroup=Delimiter start="(" skip="|.\{-}|"    matchgroup=Delimiter end=")" contains=@lispListCluster
  19. syn region    lispBQList    matchgroup=PreProc   start="`("    skip="|.\{-}|"    matchgroup=PreProc   end=")" contains=@lispListCluster
  20.  
  21. " Atoms
  22. syn match    lispAtomMark    "'"
  23. syn match    lispAtom    "'("me=e-1    contains=lispAtomMark    nextgroup=lispAtomList
  24. syn match    lispAtom    "'[^ \t()]\+"    contains=lispAtomMark
  25. syn match    lispAtomBarSymbol    !'|..\{-}|!    contains=lispAtomMark
  26. syn region    lispAtom    start=+'"+    skip=+\\"+ end=+"+
  27. syn region    lispAtomList    contained    matchgroup=Special start="("    skip="|.\{-}|" matchgroup=Special end=")"    contains=@lispAtomCluster
  28. syn match    lispAtomNmbr    contained    "\<\d\+"
  29.  
  30. " Standard Lisp Functions and Macros
  31. syn keyword lispFunc    *    concatenate    get-properties    nreverse    setq
  32. syn keyword lispFunc    +    cond    get-setf-method    nset-difference    seventh
  33. syn keyword lispFunc    -    conjugate    getf    nstring-upcase    shadow
  34. syn keyword lispFunc    /    cons    gethash    nsublis    shiftf
  35. syn keyword lispFunc    <    consp    go    nsubst    short-site-name
  36. syn keyword lispFunc    =    constantp    graphic-char-p    nsubst-if    signed-byte
  37. syn keyword lispFunc    >    copy-alist    hash-table-p    nsubst-if-not    signum
  38. syn keyword lispFunc    abs    copy-list    host-namestring    nsubstitute    simple-string-p
  39. syn keyword lispFunc    access    copy-readtable    identity    nsubstitute-if    simple-vector-p
  40. syn keyword lispFunc    acons    copy-seq    if    nth    sin
  41. syn keyword lispFunc    acos    copy-symbol    if-exists    nthcdr    sinh
  42. syn keyword lispFunc    acosh    copy-tree    ignore    null    sixth
  43. syn keyword lispFunc    adjoin    cos    imagpart    numberp    sleep
  44. syn keyword lispFunc    adjust-array    cosh    import    numerator    software-type
  45. syn keyword lispFunc    alpha-char-p    count    in-package    nunion    some
  46. syn keyword lispFunc    alphanumericp    count-if    in-package    oddp    sort
  47. syn keyword lispFunc    and    count-if-not    incf    open    special
  48. syn keyword lispFunc    append    ctypecase    inline    optimize    special-form-p
  49. syn keyword lispFunc    apply    decf    input-stream-p    or    sqrt
  50. syn keyword lispFunc    applyhook    declaration    inspect    output-stream-p    stable-sort
  51. syn keyword lispFunc    apropos    declare    int-char    package-name    standard-char-p
  52. syn keyword lispFunc    apropos-list    decode-float    integer-length    packagep    step
  53. syn keyword lispFunc    aref    defconstant    integerp    pairlis    streamup
  54. syn keyword lispFunc    array-dimension    defparameter    intern    parse-integer    string
  55. syn keyword lispFunc    array-rank    defstruct    intersection    pathname    string-char
  56. syn keyword lispFunc    array-rank-limit    defvar    isqrt    pathname-device    string-char-p
  57. syn keyword lispFunc    arrayp    delete    keyword    pathname-host    string-downcase
  58. syn keyword lispFunc    ash    delete-file    last    pathname-name    string-equal
  59. syn keyword lispFunc    asin    delete-if    lcm    pathname-type    string-greaterp
  60. syn keyword lispFunc    asinh    delete-if-not    ldb    pathnamep    string-lessp
  61. syn keyword lispFunc    assert    denominator    ldb-test    peek-char    string-trim
  62. syn keyword lispFunc    assoc    deposit-field    ldiff    phase    string-upcase
  63. syn keyword lispFunc    assoc-if    describe    length    pi    string/=
  64. syn keyword lispFunc    assoc-if-not    digit-char    let*    plusp    string<
  65. syn keyword lispFunc    atan    digit-char-p    lisp    pop    string<=
  66. syn keyword lispFunc    atanh    directory    list    position    string=
  67. syn keyword lispFunc    bit    disassemble    list*    position-if    string>
  68. syn keyword lispFunc    bit-and    do    list-length    position-if-not    string>=
  69. syn keyword lispFunc    bit-andc1    do*    listen    pprint    stringp
  70. syn keyword lispFunc    bit-andc2    do-all-symbols    listp    prin1    sublim
  71. syn keyword lispFunc    bit-eqv    do-symbols    load    prin1-to-string    subseq
  72. syn keyword lispFunc    bit-ior    documentation    log    princ    subsetp
  73. syn keyword lispFunc    bit-nand    dolist    logand    princ-to-string    subst
  74. syn keyword lispFunc    bit-nor    dotimes    logandc1    print    subst-if
  75. syn keyword lispFunc    bit-not    dpb    logandc2    probe-file    subst-if-not
  76. syn keyword lispFunc    bit-orc1    dribble    logcount    proclaim    subtypep
  77. syn keyword lispFunc    bit-orc2    ecase    logeqv    prog    svref
  78. syn keyword lispFunc    bit-vector-p    ed    logior    prog*    sxhash
  79. syn keyword lispFunc    bit-xor    eighth    lognand    prog1    symbol-function
  80. syn keyword lispFunc    block    elt    lognor    prog2    symbol-name
  81. syn keyword lispFunc    boole    endp    lognot    progn    symbol-package
  82. syn keyword lispFunc    both-case-p    eq    logorc1    progv    symbol-plist
  83. syn keyword lispFunc    boundp    eql    logorc2    provide    symbol-value
  84. syn keyword lispFunc    break    equal    logtest    psetf    symbolp
  85. syn keyword lispFunc    butlast    equalp    logxor    psetq    sys
  86. syn keyword lispFunc    byte    error    long-site-name    push    system
  87. syn keyword lispFunc    byte-position    etypecase    loop    pushnew    t
  88. syn keyword lispFunc    byte-size    eval    lower-case-p    putprop    tagbody
  89. syn keyword lispFunc    car    eval-when    machine-type    quote    tailp
  90. syn keyword lispFunc    catch    evalhook    machine-version    random    tan
  91. syn keyword lispFunc    ccase    evenp    macro-function    random-state-p    tanh
  92. syn keyword lispFunc    cdr    every    macroexpand    rassoc    tenth
  93. syn keyword lispFunc    ceiling    exp    macroexpand-l    rassoc-if    terpri
  94. syn keyword lispFunc    cerror    export    make-array    rassoc-if-not    the
  95. syn keyword lispFunc    char    expt    make-array    rational    third
  96. syn keyword lispFunc    char-bit    fboundp    make-char    rationalize    throw
  97. syn keyword lispFunc    char-bits    fceiling    make-hash-table    rationalp    time
  98. syn keyword lispFunc    char-bits-limit    ffloor    make-list    read    trace
  99. syn keyword lispFunc    char-code    fifth    make-package    read-byte    tree-equal
  100. syn keyword lispFunc    char-code-limit    file-author    make-pathname    read-char    truename
  101. syn keyword lispFunc    char-downcase    file-length    make-sequence    read-eval-print    truncase
  102. syn keyword lispFunc    char-equal    file-namestring    make-string    read-line    type
  103. syn keyword lispFunc    char-font    file-position    make-symbol    readtablep    type-of
  104. syn keyword lispFunc    char-font-limit    file-write-date    makunbound    realpart    typecase
  105. syn keyword lispFunc    char-greaterp    fill    map    reduce    typep
  106. syn keyword lispFunc    char-hyper-bit    fill-pointer    mapc    rem    unexport
  107. syn keyword lispFunc    char-int    find    mapcan    remf    unintern
  108. syn keyword lispFunc    char-lessp    find-if    mapcar    remhash    union
  109. syn keyword lispFunc    char-meta-bit    find-if-not    mapcon    remove    unless
  110. syn keyword lispFunc    char-name    find-package    maphash    remove-if    unread
  111. syn keyword lispFunc    char-not-equal    find-symbol    mapl    remove-if-not    unsigned-byte
  112. syn keyword lispFunc    char-not-lessp    finish-output    maplist    remprop    untrace
  113. syn keyword lispFunc    char-super-bit    first    mask-field    rename-file    unuse-package
  114. syn keyword lispFunc    char-upcase    float    max    rename-package    unwind-protect
  115. syn keyword lispFunc    char/=    float-digits    member    replace    upper-case-p
  116. syn keyword lispFunc    char<    float-precision    member-if    require    use-package
  117. syn keyword lispFunc    char<=    float-radix    member-if-not    rest    user
  118. syn keyword lispFunc    char=    float-sign    merge    return    values
  119. syn keyword lispFunc    char>    floatp    merge-pathname    return-from    values-list
  120. syn keyword lispFunc    char>=    floor    min    revappend    vector
  121. syn keyword lispFunc    character    fmakunbound    minusp    reverse    vector-pop
  122. syn keyword lispFunc    characterp    force-output    mismatch    room    vector-push
  123. syn keyword lispFunc    check-type    fourth    mod    rotatef    vectorp
  124. syn keyword lispFunc    cis    fresh-line    name-char    round    warn
  125. syn keyword lispFunc    clear-input    fround    namestring    rplaca    when
  126. syn keyword lispFunc    clear-output    ftruncate    nbutlast    rplacd    with-open-file
  127. syn keyword lispFunc    close    ftype    nconc    sbit    write
  128. syn keyword lispFunc    clrhash    funcall    nil    scale-float    write-byte
  129. syn keyword lispFunc    code-char    function    nintersection    schar    write-char
  130. syn keyword lispFunc    coerce    functionp    ninth    search    write-line
  131. syn keyword lispFunc    commonp    gbitp    not    second    write-string
  132. syn keyword lispFunc    compile    gcd    notany    set    write-to-string
  133. syn keyword lispFunc    compile-file    gensym    notevery    set-char-bit    y-or-n-p
  134. syn keyword lispFunc    compiler-let    gentemp    notinline    set-difference    yes-or-no-p
  135. syn keyword lispFunc    complex    get    nreconc    setf    zerop
  136. syn keyword lispFunc    complexp
  137. syn match   lispFunc    "\<c[ad]\+r\>"
  138.  
  139. syn keyword lispFunc    adjustable-array-p        least-negative-short-float    nstring-capitalize
  140. syn keyword lispFunc    array-dimension-limit    least-negative-single-float    nstring-downcase
  141. syn keyword lispFunc    array-dimensions        least-positive-double-float    nsubstitute-if-not
  142. syn keyword lispFunc    array-element-type        least-positive-long-float    package-nicknames
  143. syn keyword lispFunc    array-has-fill-pointer-p    least-positive-short-float    package-shadowing-symbols
  144. syn keyword lispFunc    array-in-bounds-p        least-positive-single-float    package-use-list
  145. syn keyword lispFunc    array-row-major-index    lisp-implementation-type    package-used-by-list
  146. syn keyword lispFunc    array-total-size        lisp-implementation-version    parse-namestring
  147. syn keyword lispFunc    array-total-size-limit    list-all-packages        pathname-directory
  148. syn keyword lispFunc    call-arguments-limit        long-float-epsilon        pathname-version
  149. syn keyword lispFunc    char-control-bit        long-float-negative-epsilon    read-char-no-hang
  150. syn keyword lispFunc    char-not-greaterp        machine-instance        read-delimited-list
  151. syn keyword lispFunc    compiled-function-p        make-broadcast-stream    read-from-string
  152. syn keyword lispFunc    decode-universal-time    make-concatenated-stream    read-preserving-whitespace
  153. syn keyword lispFunc    define-modify-macro        make-dispatch-macro-character    remove-duplicates
  154. syn keyword lispFunc    define-setf-method        make-echo-stream        set-dispatch-macro-character
  155. syn keyword lispFunc    delete-duplicates        make-random-state        set-exclusive-or
  156. syn keyword lispFunc    directory-namestring        make-string-input-stream    set-macro-character
  157. syn keyword lispFunc    do-exeternal-symbols        make-string-output-stream    set-syntax-from-char
  158. syn keyword lispFunc    double-float-epsilon        make-synonym-stream        shadowing-import
  159. syn keyword lispFunc    double-float-negative-epsilon    make-two-way-stream        short-float-epsilon
  160. syn keyword lispFunc    encode-universal-time    most-negative-double-float    simple-bit-vector-p
  161. syn keyword lispFunc    enough-namestring        most-negative-fixnum        single-flaot-epsilon
  162. syn keyword lispFunc    find-all-symbols        most-negative-long-float    single-float-negative-epsilon
  163. syn keyword lispFunc    get-decoded-time        most-negative-short-float    software-version
  164. syn keyword lispFunc    get-dispatch-macro-character    most-negative-single-float    stream-element-type
  165. syn keyword lispFunc    get-internal-real-time    most-positive-double-float    string-capitalize
  166. syn keyword lispFunc    get-internal-run-time    most-positive-fixnum        string-left-trim
  167. syn keyword lispFunc    get-macro-character        most-positive-long-float    string-not-equal
  168. syn keyword lispFunc    get-output-stream-string    most-positive-short-float    string-not-greaterp
  169. syn keyword lispFunc    get-universal-time        most-positive-single-float    string-not-lessp
  170. syn keyword lispFunc    hash-table-count        multiple-value-bind        string-right-strim
  171. syn keyword lispFunc    integer-decode-float        multiple-value-call        user-homedir-pathname
  172. syn keyword lispFunc    internal-time-units-per-second    multiple-value-list        vector-push-extend
  173. syn keyword lispFunc    lambda-list-keywords        multiple-value-prog1        with-input-from-string
  174. syn keyword lispFunc    lambda-parameters-limit    multiple-value-seteq        with-open-stream
  175. syn keyword lispFunc    least-negative-double-float    multiple-values-limit    with-output-to-string
  176. syn keyword lispFunc    least-negative-long-float    nset-exclusive-or
  177.  
  178. " Lisp Keywords (modifiers)
  179. syn keyword lispKey    :abort    :device    :if-exists    :name    :rehash-size
  180. syn keyword lispKey    :adjustable    :direction    :include    :named    :rename
  181. syn keyword lispKey    :append    :directory    :index    :new-version    :size
  182. syn keyword lispKey    :array    :displaced-to    :inherited    :nicknames    :start
  183. syn keyword lispKey    :base    :element-type    :initial-element    :output    :start1
  184. syn keyword lispKey    :case    :end    :initial-offset    :output-file    :start2
  185. syn keyword lispKey    :circle    :end1    :initial-value    :overwrite    :stream
  186. syn keyword lispKey    :conc-name    :end2    :input    :predicate    :supersede
  187. syn keyword lispKey    :constructor    :error    :internal    :pretty    :test
  188. syn keyword lispKey    :copier    :escape    :io    :print    :test-not
  189. syn keyword lispKey    :count    :external    :junk-allowed    :print-function    :type
  190. syn keyword lispKey    :create    :from-end    :key    :probe    :use
  191. syn keyword lispKey    :default    :gensym    :length    :radix    :verbose
  192. syn keyword lispKey    :defaults    :host    :level    :read-only    :version
  193.  
  194. syn keyword lispKey    :displaced-index-offset    :initial-contents        :rehash-threshold
  195. syn keyword lispKey    :if-does-not-exist    :preserve-whitespace    :rename-and-delete
  196.  
  197. " Standard Lisp Variables
  198. syn keyword lispVar    *applyhook*    *modules*    *print-circle*    *print-pretty*    *read-suppress*
  199. syn keyword lispVar    *debug-io*    *package*    *print-escape*    *print-radix*    *readtable*
  200. syn keyword lispVar    *error-output*    *print-array*    *print-gensym*    *query-io*    *standard-input*
  201. syn keyword lispVar    *evalhook*    *print-base*    *print-length*    *random-state*    *terminal-io*
  202. syn keyword lispVar    *features*    *print-case*    *print-level*    *read-base*    *trace-output*
  203. syn keyword lispVar    *load-verbose*
  204.  
  205. syn keyword lispVar    *break-on-warnings*    *macroexpand-hook*    *standard-output*
  206. syn keyword lispVar    *default-pathname-defaults*    *read-default-float-format*
  207.  
  208. " Strings
  209. syn region    lispString    start=+"+    skip=+\\\\\|\\"+ end=+"+
  210.  
  211. " Shared with Xlisp, Declarations, Macros, Functions
  212. syn keyword lispDecl    defmacro    defun    do-external-symbols flet    locally
  213. syn keyword lispDecl    defsetf    do*    do-symbols    labels    macrolet
  214. syn keyword lispDecl    deftype    do-all-symbols    dotimes    let    multiple-value-bind
  215.  
  216. syn match lispNumber    "\d\+"
  217.  
  218. syn match lispSpecial    "\*[a-zA-Z_][a-zA-Z_0-9-]*\*"
  219. syn match lispSpecial    !#|[^()'`,"; \t]\+|#!
  220. syn match lispSpecial    !#x[0-9a-fA-F]\+!
  221. syn match lispSpecial    !#o[0-7]\+!
  222. syn match lispSpecial    !#b[01]\+!
  223. syn match lispSpecial    !#\\[ -\~]!
  224. syn match lispSpecial    !#[':][^()'`,"; \t]\+!
  225. syn match lispSpecial    !#([^()'`,"; \t]\+)!
  226.  
  227. syn match lispConcat    "\s\.\s"
  228. syn match lispParenError    ")"
  229.  
  230. " Comments
  231. syn match lispComment    ";.*$"
  232.  
  233. " synchronization
  234. syn sync lines=100
  235.  
  236. if !exists("did_lisp_syntax_inits")
  237.   let did_lisp_syntax_inits= 1
  238.   hi link lispAtomNmbr    lispNumber
  239.   hi link lispAtomMark    lispMark
  240.  
  241.   hi link lispAtom        Identifier
  242.   hi link lispAtomBarSymbol    Special
  243.   hi link lispBarSymbol    Special
  244.   hi link lispComment    Comment
  245.   hi link lispConcat        Statement
  246.   hi link lispDecl        Statement
  247.   hi link lispFunc        Statement
  248.   hi link lispKey        Type
  249.   hi link lispMark        Delimiter
  250.   hi link lispNumber        Number
  251.   hi link lispParenError    Error
  252.   hi link lispSpecial    Type
  253.   hi link lispString        String
  254.   hi link lispVar        Statement
  255.   endif
  256.  
  257. let b:current_syntax = "lisp"
  258.  
  259. " vim: ts=21 nowrap
  260.