home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_vim.idb / usr / freeware / share / vim / syntax / vim.vim.z / vim.vim
Encoding:
Text File  |  1998-10-28  |  20.6 KB  |  376 lines

  1. " Vim syntax file
  2. " Language:    Vim script
  3. " Maintainer:    Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
  4. " Last change:    February 16, 1998
  5.  
  6. " Remove old syntax
  7. syn clear
  8.  
  9. syn keyword vimTodo contained    TODO
  10.  
  11. " regular vim commands
  12. syn keyword vimCommand contained    I    d[elete]    mak[e]    sal[l]    wh[ile]
  13. syn keyword vimCommand contained    N[ext]    di[splay]    map    sbN[ext]    wn[ext]
  14. syn keyword vimCommand contained    a[ppend]    dig[raphs]    mapc[lear]    sb[uffer]    wp[revous]
  15. syn keyword vimCommand contained    ab[breviate]    display    marks    sba[ll]    wq
  16. syn keyword vimCommand contained    abc[lear]    dj[ump]    mk[exrc]    sbl[ast]    wqa[ll]
  17. syn keyword vimCommand contained    al[l]    dl[ist]    mkv[imrc]    sbm[odified]    wqall
  18. syn keyword vimCommand contained    ar[gs]    do[autocmd]    mod[e]    sbn[ext]    wv[iminfo]
  19. syn keyword vimCommand contained    argu[ment]    doautoa[ll]    n[ext]    sbp[revious]    x[it]
  20. syn keyword vimCommand contained    as[cii]    ds[earch]    new    sbr[ewind]    xa[ll]
  21. syn keyword vimCommand contained    au[tocmd]    dsp[lit]    nm[ap]    se[t]    xall
  22. syn keyword vimCommand contained    aug[roup]    e[dit]    nmap    set    y[ank]
  23. syn keyword vimCommand contained    autocmd    ec[ho]    nmapc[lear]    sh[ell]    am
  24. syn keyword vimCommand contained    bN[ext]    echon    nn[oremap]    sl[eep]    amenu
  25. syn keyword vimCommand contained    b[uffer]    else    no[remap]    sla[st]    an
  26. syn keyword vimCommand contained    ba[ll]    elsei[f]    norea[bbrev]    sn[ext]    anoremenu
  27. syn keyword vimCommand contained    bd[elete]    en[dif]    norm[al]    so[urce]    aun
  28. syn keyword vimCommand contained    bdelete    endw[hile]    normal    sp[lit]    aunmenu
  29. syn keyword vimCommand contained    bl[ast]    ex    nu[mber]    spr[evious]    cme
  30. syn keyword vimCommand contained    bm[odified]    exe[cute]    nun[map]    sr[ewind]    cmenu
  31. syn keyword vimCommand contained    bn[ext]    exi[t]    o[pen]    st[op]    cnoreme
  32. syn keyword vimCommand contained    bp[revious]    f[ile]    om[ap]    sta[g]    cnoremenu
  33. syn keyword vimCommand contained    br[ewind]    files    omap    sts[elect]    cunme
  34. syn keyword vimCommand contained    brea[k]    fix[del]    omapc[lear]    sun[hide]    cunmenu
  35. syn keyword vimCommand contained    buffers    g[lobal]    on[ly]    sus[pend]    ime
  36. syn keyword vimCommand contained    bun[load]    global    ono[remap]    sv[iew]    imenu
  37. syn keyword vimCommand contained    bunload    h[elp]    ou[nmap]    syntax    inoreme
  38. syn keyword vimCommand contained    cN[ext]    hid[e]    p[rint]    t    inoremenu
  39. syn keyword vimCommand contained    c[hange]    highlight    pe[rl]    tN[ext]    iunme
  40. syn keyword vimCommand contained    ca[bbrev]    i[nsert]    perld[o]    ta[g]    iunmenu
  41. syn keyword vimCommand contained    cabc[lear]    ia[bbrev]    po[p]    tags    me
  42. syn keyword vimCommand contained    cc    iabc[lear]    pre[serve]    the    menu
  43. syn keyword vimCommand contained    cd    if    prev[ious]    tl[ast]    nme
  44. syn keyword vimCommand contained    ce[nter]    ij[ump]    pw[d]    tn[ext]    nmenu
  45. syn keyword vimCommand contained    cf[ile]    il[ist]    py[thon]    tp[revious]    nnoreme
  46. syn keyword vimCommand contained    chd[ir]    im[ap]    pyf[ile]    tr[ewind]    nnoremenu
  47. syn keyword vimCommand contained    che[ckpath]    imap    q[uit]    ts[elect]    noreme
  48. syn keyword vimCommand contained    cl[ist]    imapc[lear]    qa[ll]    u[ndo]    noremenu
  49. syn keyword vimCommand contained    clast    ino[remap]    qall    una[bbreviate]    nunme
  50. syn keyword vimCommand contained    clo[se]    inorea[bbrev]    quit    unh[ide]    nunmenu
  51. syn keyword vimCommand contained    cm[ap]    is[earch]    r[ead]    unl[et]    ome
  52. syn keyword vimCommand contained    cmap    isp[lit]    rec[over]    unm[ap]    omenu
  53. syn keyword vimCommand contained    cmapc[lear]    iu[nmap]    red[o]    v[global]    onoreme
  54. syn keyword vimCommand contained    cn[ext]    iuna[bbrev]    redi[r]    ve[rsion]    onoremenu
  55. syn keyword vimCommand contained    cno[remap]    j[oin]    reg[isters]    vi[sual]    ounme
  56. syn keyword vimCommand contained    cnorea[bbrev]    ju[mps]    res[ize]    vie[w]    ounmenu
  57. syn keyword vimCommand contained    co[py]    k    resize    vm[ap]    unme
  58. syn keyword vimCommand contained    con[tinue]    l[ist]    ret[ab]    vmap    unmenu
  59. syn keyword vimCommand contained    cp[revious]    la[st]    rew[ind]    vmapc[lear]    vme
  60. syn keyword vimCommand contained    cq    le[ft]    ri[ght]    vn[oremap]    vmenu
  61. syn keyword vimCommand contained    cq[uit]    let    rv[iminfo]    vu[nmap]    vnoreme
  62. syn keyword vimCommand contained    crewind    ls    sN[ext]    wN[ext]    vnoremenu
  63. syn keyword vimCommand contained    cu[nmap]    m[ove]    s[ubstitute]    w[rite]    vunme
  64. syn keyword vimCommand contained    cuna[bbrev]    ma[rk]    sa[rgument]    wa[ll]    vunmenu
  65.  
  66. " All vimCommands are contained by vimIsCommands.
  67. syn match vimIsCommand    "^\s*[a-zA-Z]\+"        transparent contains=vimCommand
  68. syn match vimIsCommand    "[:|]\s*[a-zA-Z]\+"    transparent contains=vimCommand
  69.  
  70. " vimOptions are caught only when contained in a vimSet
  71. syn keyword vimOption contained    ai    equalprg    isprint    sb    tags
  72. syn keyword vimOption contained    akm    errorbells    joinspaces    sbr    tbi
  73. syn keyword vimOption contained    al    errorfile    js    sc    tbs
  74. syn keyword vimOption contained    aleph    errorformat    keywordprg    scr    term
  75. syn keyword vimOption contained    altkeymap    esckeys    kp    scroll    terse
  76. syn keyword vimOption contained    autoindent    et    langmap    scrolljump    textauto
  77. syn keyword vimOption contained    autowrite    eventignore    laststatus    scrolloff    textmode
  78. syn keyword vimOption contained    aw    ex    lazyredraw    scs    textwidth
  79. syn keyword vimOption contained    background    expandtab    lbr    sect    tf
  80. syn keyword vimOption contained    backspace    exrc    linebreak    sections    tildeop
  81. syn keyword vimOption contained    backup    ff    lines    secure    timeout
  82. syn keyword vimOption contained    backupdir    ffs    lisp    sh    timeoutlen
  83. syn keyword vimOption contained    backupext    fileformat    list    shcf    title
  84. syn keyword vimOption contained    bdir    fileformats    lmap    shell    titlelen
  85. syn keyword vimOption contained    bex    fk    ls    shellcmdflag    titlestring
  86. syn keyword vimOption contained    bg    fkmap    lz    shellpipe    tl
  87. syn keyword vimOption contained    bin    fo    magic    shellquote    tm
  88. syn keyword vimOption contained    binary    formatoptions    makeef    shellredir    to
  89. syn keyword vimOption contained    biosk    formatprg    makeprg    shelltype    top
  90. syn keyword vimOption contained    bioskey    fp    mat    shellxquote    tr
  91. syn keyword vimOption contained    bk    gcr    matchtime    shiftround    ts
  92. syn keyword vimOption contained    breakat    gd    maxmapdepth    shiftwidth    tsl
  93. syn keyword vimOption contained    brk    gdefault    maxmem    shm    ttimeout
  94. syn keyword vimOption contained    bs    gfn    maxmemtot    shortmess    ttimeoutlen
  95. syn keyword vimOption contained    ch    go    mef    shortname    ttm
  96. syn keyword vimOption contained    cin    guicursor    mh    showbreak    ttybuiltin
  97. syn keyword vimOption contained    cindent    guifont    ml    showcmd    ttyfast
  98. syn keyword vimOption contained    cink    guioptions    mls    showmatch    ttyscroll
  99. syn keyword vimOption contained    cinkeys    guipty    mm    showmode    ttytype
  100. syn keyword vimOption contained    cino    helpfile    mmd    shq    tw
  101. syn keyword vimOption contained    cinoptions    helpheight    mmt    si    tx
  102. syn keyword vimOption contained    cinw    hf    mod    sidescroll    uc
  103. syn keyword vimOption contained    cinwords    hh    modeline    sj    ul
  104. syn keyword vimOption contained    cmdheight    hi    modelines    sm    undolevels
  105. syn keyword vimOption contained    co    hid    modified    smartcase    updatecount
  106. syn keyword vimOption contained    columns    hidden    more    smartindent    updatetime
  107. syn keyword vimOption contained    com    highlight    mouse    smarttab    ut
  108. syn keyword vimOption contained    comments    history    mousehide    smd    vb
  109. syn keyword vimOption contained    compatible    hk    mouset    sn    vbs
  110. syn keyword vimOption contained    complete    hkmap    mousetime    so    verbose
  111. syn keyword vimOption contained    cp    hkmapp    mp    softtabstop    vi
  112. syn keyword vimOption contained    cpo    hkp    nf    sol    viminfo
  113. syn keyword vimOption contained    cpoptions    hl    nrformats    sp    visualbell
  114. syn keyword vimOption contained    cpt    hls    nu    splitbelow    wa
  115. syn keyword vimOption contained    def    hlsearch    number    sr    warn
  116. syn keyword vimOption contained    define    ic    pa    srr    wb
  117. syn keyword vimOption contained    dg    icon    para    ss    wc
  118. syn keyword vimOption contained    dict    iconstring    paragraphs    st    wd
  119. syn keyword vimOption contained    dictionary    ignorecase    paste    sta    weirdinvert
  120. syn keyword vimOption contained    digraph    im    patchmode    startofline    wh
  121. syn keyword vimOption contained    dir    inc    path    sts    whichwrap
  122. syn keyword vimOption contained    directory    include    pm    su    wildchar
  123. syn keyword vimOption contained    ea    incsearch    readonly    suffixes    winheight
  124. syn keyword vimOption contained    eb    inf    remap    sw    wiv
  125. syn keyword vimOption contained    ed    infercase    report    swapsync    wm
  126. syn keyword vimOption contained    edcompatible    insertmode    restorescreen    sws    wrap
  127. syn keyword vimOption contained    ef    is    revins    sxq    wrapmargin
  128. syn keyword vimOption contained    efm    isf    ri    ta    wrapscan
  129. syn keyword vimOption contained    ei    isfname    rightleft    tabstop    writeany
  130. syn keyword vimOption contained    ek    isi    rl    tag    writebackup
  131. syn keyword vimOption contained    endofline    isident    ro    tagbsearch    writedelay
  132. syn keyword vimOption contained    eol    isk    rs    taglength    ws
  133. syn keyword vimOption contained    ep    iskeyword    ru    tagrelative    ww
  134. syn keyword vimOption contained    equalalways    isp    ruler
  135.  
  136. " These are the turn-off setting variants
  137. syn keyword vimOption contained    noai    noesckeys    nojoinspaces    noruler    noterse
  138. syn keyword vimOption contained    noakm    noet    nojs    nosb    notextauto
  139. syn keyword vimOption contained    noalkeymap    noex    nolbr    nosc    notextmode
  140. syn keyword vimOption contained    noautoindent    noexpandtab    nolinebreak    noscs    notf
  141. syn keyword vimOption contained    noautowrite    noexrc    nolisp    nosecure    notildeop
  142. syn keyword vimOption contained    noaw    nofk    nolist    noshiftround    notimeout
  143. syn keyword vimOption contained    nobackup    nofkmap    nomagic    noshortname    notitle
  144. syn keyword vimOption contained    nobin    nogd    nomh    noshowcmd    noto
  145. syn keyword vimOption contained    nobinary    nogdefault    noml    noshowmatch    notop
  146. syn keyword vimOption contained    nobiosk    noguipty    nomod    noshowmode    notr
  147. syn keyword vimOption contained    nobioskey    nohid    nomodeline    nosi    nottimeout
  148. syn keyword vimOption contained    nobk    nohidden    nomodified    nosm    nottybuiltin
  149. syn keyword vimOption contained    nocin    nohk    nomore    nosmartcase    nottyfast
  150. syn keyword vimOption contained    nocindent    nohkmap    nomousehide    nosmartindent    notx
  151. syn keyword vimOption contained    nocompatible    nohkmapp    nonu    nosmarttab    novb
  152. syn keyword vimOption contained    nocp    nohkp    nonumber    nosmd    novisualbell
  153. syn keyword vimOption contained    nodg    nohls    nopaste    nosn    nowa
  154. syn keyword vimOption contained    nodigraph    nohlsearch    noreadonly    nosol    nowarn
  155. syn keyword vimOption contained    noea    noic    noremap    nosplitbelow    nowb
  156. syn keyword vimOption contained    noeb    noicon    norestorescreen    nosr    noweirdinvert
  157. syn keyword vimOption contained    noed    noignorecase    norevins    nosta    nowiv
  158. syn keyword vimOption contained    noedcompatible    noim    nori    nostartofline    nowrap
  159. syn keyword vimOption contained    noek    noincsearch    norightleft    nota    nowrapscan
  160. syn keyword vimOption contained    noendofline    noinf    norl    notagbsearch    nowriteany
  161. syn keyword vimOption contained    noeol    noinfercase    noro    notagrelative    nowritebackup
  162. syn keyword vimOption contained    noequalalways    noinsertmode    nors    notbi    nows
  163. syn keyword vimOption contained    noerrorbells    nois    noru    notbs
  164.  
  165. " termcap codes (which can also be set)
  166. syn keyword vimOption contained    t_AB    t_RI    t_da    t_k9    t_ks    t_so
  167. syn keyword vimOption contained    t_AF    t_Sb    t_db    t_kD    t_ku    t_sr
  168. syn keyword vimOption contained    t_AL    t_Sf    t_dl    t_kI    t_le    t_te
  169. syn keyword vimOption contained    t_CS    t_ZH    t_k1    t_kN    t_mb    t_ti
  170. syn keyword vimOption contained    t_Co    t_ZR    t_k2    t_kP    t_md    t_ue
  171. syn keyword vimOption contained    t_DL    t_al    t_k3    t_kb    t_me    t_us
  172. syn keyword vimOption contained    t_F1    t_bc    t_k4    t_kd    t_mr    t_vb
  173. syn keyword vimOption contained    t_F2    t_cd    t_k5    t_ke    t_ms    t_ve
  174. syn keyword vimOption contained    t_K1    t_ce    t_k6    t_kh    t_nd    t_vi
  175. syn keyword vimOption contained    t_K3    t_cl    t_k7    t_kl    t_op    t_vs
  176. syn keyword vimOption contained    t_K4    t_cm    t_k8    t_kr    t_se    t_xs
  177. syn keyword vimOption contained    t_K5    t_cs
  178. syn match   vimOption contained    "t_#4"
  179. syn match   vimOption contained    "t_%1"
  180. syn match   vimOption contained    "t_%i"
  181. syn match   vimOption contained    "t_&8"
  182. syn match   vimOption contained    "t_@7"
  183. syn match   vimOption contained    "t_k;"
  184.  
  185. " these settings don't actually cause errors in vim, but were supported by vi and don't do anything in vim
  186. syn keyword vimErrSetting contained    ap    gr    op    slow    w1200
  187. syn keyword vimErrSetting contained    autoprint    graphic    open    slowopen    w300
  188. syn keyword vimErrSetting contained    beautify    hardtabs    optimize    sourceany    w9600
  189. syn keyword vimErrSetting contained    bf    ht    prompt    tagstack    wi
  190. syn keyword vimErrSetting contained    fl    mesg    redraw    tgst    window
  191. syn keyword vimErrSetting contained    flash    novice
  192.  
  193. " AutoBuf Events
  194. syn keyword vimAutoEvent contained    BufDelete    BufReadPre    FileAppendPre    FilterReadPost    TermChanged
  195. syn keyword vimAutoEvent contained    BufEnter    BufUnload    FileChangedShell    FilterReadPre    User
  196. syn keyword vimAutoEvent contained    BufLeave    BufWrite    FileReadPost    FilterWritePost    VimLeave
  197. syn keyword vimAutoEvent contained    BufNewFile    BufWritePost    FileReadPre    FilterWritePre    WinEnter
  198. syn keyword vimAutoEvent contained    BufRead    BufWritePre    FileWritePost    StdinReadPost    WinLeave
  199. syn keyword vimAutoEvent contained    BufReadPost    FileAppendPost    FileWritePre    StdinReadPre
  200.  
  201. " Highlight commonly used Groupnames
  202. syn keyword vimGroup    Comment    Identifier    Keyword    Type    Tag
  203. syn keyword vimGroup    Constant    Function    Exception    StorageClass    Delimiter
  204. syn keyword vimGroup    String    Statement    PreProc    Structure    SpecialComment
  205. syn keyword vimGroup    Character    Conditional    Include    Typedef    Debug
  206. syn keyword vimGroup    Number    Repeat    Define    Special    Error
  207. syn keyword vimGroup    Boolean    Label    Macro    SpecialChar    Todo
  208. syn keyword vimGroup    Float    Operator    PreCondit
  209.  
  210. " Default highlighting groups
  211. syn keyword vimHLGroup    Cursor    IncSearch    ModeMsg    Normal    Search    Title
  212. syn keyword vimHLGroup    Debug,    LineNr    MoreMsg    Question    SpecialKey    Visual
  213. syn keyword vimHLGroup    Directory    Menu    NonText    Scrollbar    StatusLine    WarningMsg
  214. syn keyword vimHLGroup    ErrorMsg
  215.  
  216. "--- syntax above generated by mkvimvim ---
  217. " Highlight syntax stuff
  218.  
  219. syn match   vimMark    "'[a-zA-Z0-9]"
  220. syn match   vimRegister    '"[a-zA-Z0-9\-:.%#*=]'
  221.  
  222. syn keyword vimPattern contained    start    skip    end
  223.  
  224. syn keyword vimSpecial    ALL    ccomment    matchgroup    skipempty    sync
  225. syn keyword vimSpecial    NONE    lines    minlines    skipnl    transparent
  226.  
  227. " Highlight syntax stuff -- the following vimSpecials aren't keywords because Vim's syntax checking
  228. " disapproves
  229. syn match vimSpecial    contained    "\<ALLBUT\>"
  230. syn match vimSpecial    contained    "\<clear\>"
  231. syn match vimSpecial    contained    "\<contained\>"
  232. syn match vimSpecial    contained    "\<oneline\>"
  233. syn match vimSpecial    contained    "\<contains\>"
  234. syn match vimSpecial    contained    "\<grouphere\>"
  235. syn match vimSpecial    contained    "\<groupthere\>"
  236. syn match vimSpecial    contained    "\<keepend\>"
  237. syn match vimSpecial    contained    "\<maxlines\>"
  238. syn match vimSpecial    contained    "\<nextgroup\>"
  239. syn match vimSpecial    contained    "\<skipempty\>"
  240. syn match vimSpecial    contained    "\<skipnl\>"
  241. syn match vimSpecial    contained    "\<skipwhite\>"
  242. syn match vimSpecial    contained    "\<transparent\>"
  243.  
  244. " Highlight Terminal Stuff
  245. syn keyword vimTermSet  contained    background    cterm    ctermfg    font    gui    guifg
  246. syn keyword vimTermSet  contained    bg    ctermbg    fg    foreground    guibg    term    start
  247. syn match   vimTermSet  contained    "stop"
  248.  
  249. " Special Filenames and Modifiers
  250. syn match vimSpecFile    "<\(cword\|cWORD\|[cas]file\)>"    nextgroup=vimSpecFileMod
  251. syn match vimSpecFile    "#[0-9]\|[#%]"        nextgroup=vimSpecFileMod
  252. syn match vimSpecFileMod    "\(:[phtre]\)\+"        contained
  253.  
  254. " commands, function, and conditionals
  255. syn keyword vimFunction    buffer_exists exists expand file_readable getline has highlight_exists last_buffer_nr ret strftime strlen substr
  256.  
  257. syn match vimConditional    "^\s*\(continue\|con\)\>"
  258. syn match vimConditional    "^\s*\(endif\|en\)\>"
  259. syn match vimConditional    "^\s*\(endwhile\|endw\)\>"
  260. syn match vimConditional    "^\s*\(while\|wh\)\>"
  261. syn match vimConditional    "^\s*break\=\>"
  262. syn match vimConditional    "^\s*else\>"
  263. syn match vimConditional    "^\s*elseif\=\>"
  264. syn match vimConditional    "^\s*if\>"
  265.  
  266. " Operators
  267. syn match vimOper    "||\|&&\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|+\|-\|=\|\."
  268.  
  269. " Numbers
  270. syn match vimNumber    "\<[0-9]\+.[0-9]\+"
  271. syn match vimNumber    "\<[0-9]\+L\="
  272. syn match vimNumber    "-[0-9]\+.[0-9]\+"
  273. syn match vimNumber    "-[0-9]\+L\="
  274. syn match vimNumber    "[[;:][0-9]\+"lc=1
  275. syn match vimNumber    "0[xX][0-9a-fA-F]\+"
  276. syn match vimNumber    "#[0-9a-fA-F]\+"
  277.  
  278. " A comment after a command starts with a ".  Note that the second
  279. " rule allows "..." to be a comment, but the first rule will
  280. " only highlight comments "... with no " in the comment.
  281. syn match vimComment    +\s"[^\-:.%#=*].*$+lc=1    contains=vimTodo
  282. syn match vimComment    +^\s*".*$+        contains=vimTodo
  283. syn match vimComment    +\<endif\s\+".*$+lc=5    contains=vimTodo
  284. syn match vimComment    +\<else\s\+".*$+lc=4    contains=vimTodo
  285.  
  286. " A comment line starts with a " at the start of the line
  287. syn match vimComment    +^\s*".*$+    contains=vimTodo
  288.  
  289. " Try to catch strings, if nothing else matches (therefore it must precede the others!)
  290. "  vmEscapeBrace handles ["]  []"] (ie. stays as string)
  291. syn region    vimEscapeBrace    start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1    oneline contained transparent
  292. syn match    vimPatSep    "\\[|()]"hs=e-1    contained
  293. syn match    vimNotPatSep    "\\\\"    contained
  294. syn region    vimString    start=+[^:,a-zA-Z>!]"+lc=1 skip=+\\\\\|\\"+ end=+"+ oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  295. syn region    vimString    start=+[^:,a-zA-Z>!]'+lc=1 skip=+\\\\\|\\'+ end=+'+ oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  296. syn region    vimString    start=+=!+lc=1    skip=+\\\\\|\\!+ end=+!+    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  297. syn region    vimString    start="=+"lc=1    skip="\\\\\|\\+" end="+"    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  298. syn region    vimString    start="\s+"lc=1    skip="\\\\\|\\+" end="+\s"me=e-1    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  299.  
  300. " set command and associated set-options (vimOptions) with comment
  301. syn region vimSet matchgroup=vimCommand start="\s*set\>" end="|\|$"    keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString
  302. syn region vimSetEqual  contained    start="="    skip="\(\\\\\)*\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar
  303. syn region vimSetString contained    start=+="+hs=s+1    skip=+\(\\\\\)\\"+   end=+"+    contains=vimCtrlChar
  304.  
  305. " highlight modifiers
  306. syn keyword VimHLMod contained NONE bold inverse italic reverse standout underline
  307.  
  308. " autocmd
  309. syn match  vimIsCommand2 "[ \t<Bar>][a-zA-Z_]\+"lc=1 transparent contained contains=vimCommand
  310. syn region vimAutoCmd matchgroup=vimAutoSet start=+^\s*\(autocmd\|au\)\>+    end="$" keepend contains=vimAutoEvent,vimSet,vimIsCommand,vimIsCommand2,vimString,vimComment,vimSpecFile,vimNotation
  311. syn region vimAutoCmd matchgroup=vimAutoSet start=+^\s*\(doautoa\|doautoall\)\>+    end="$" keepend contains=vimAutoEvent,vimSet,vimIsCommand,vimIsCommand2,vimString,vimComment,vimSpecFile,vimNotation
  312.  
  313. " Syntax regions (all oneliners)
  314. syn keyword vimKeyword contained link match
  315. syn keyword vimCase    contained ignore match
  316. syn region vimSynLine matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+keyword" end="$"    keepend contains=vimKeyword,vimSpecial,vimComment
  317. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+region" end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimPattern,vimComment
  318. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+match" end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimComment
  319. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+clear"rs=e-5 end="$"    keepend contains=vimSpecial,vimComment
  320. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+case" end="$"    keepend contains=vimCase,vimComment
  321. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+sync" end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimComment
  322. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(highlight\|hi\)\s" end="$"        keepend contains=vimKeyword,vimSpecial,vimGroup,vimTermSet,vimComment,vimCtrlChar,VimRegion,vimNotation,vimNumber,vimHLMod
  323.  
  324. " Angle-Bracket Notation
  325. syn match vimNotation    "<[a-zA-Z][a-zA-Z0-9]\+>"        contains=vimBracket
  326. syn match vimNotation    "<[a-zA-Z0-9]\+>"        contains=vimBracket
  327. syn match vimNotation    "<C-[A-Z]>"            contains=vimBracket
  328. syn match vimNotation    "<[AM]-.>"            contains=vimBracket
  329. syn match vimNotation    "<[SCAM]-\(Right\|Left\|Down\|Up\)>"    contains=vimBracket
  330. syn match vimNotation    "<S-F[0-9]>"            contains=vimBracket
  331. syn match vimBracket contained    "[<>]"
  332.  
  333. " Control Characters
  334. syn match vimCtrlChar    "[- -]"
  335.  
  336. if !exists("did_vim_syntax_inits")
  337.   let did_vim_syntax_inits = 1
  338.   " The default methods for highlighting.  Can be overridden later
  339.   hi link vimAutoSet    vimCommand
  340.   hi link vimConditional    vimStatement
  341.   hi link vimHLGroup    vimGroup
  342.   hi link vimNotPatSep    vimString
  343.   hi link vimSetString    vimString
  344.   hi link vimSpecFileMod    vimSpecFile
  345.   hi link vimTerminal    vimGroup
  346.  
  347.   hi link vimAutoEvent    Type
  348.   hi link vimBracket    Delimiter
  349.   hi link vimCommand    Statement
  350.   hi link vimComment    Comment
  351.   hi link vimCtrlChar    SpecialChar
  352.   hi link vimErrSetting    Error
  353.   hi link vimFunction    Function
  354.   hi link vimGroup    Type
  355.   hi link vimHLMod    PreProc
  356.   hi link vimKeyword    Statement
  357.   hi link vimMark    Number
  358.   hi link vimNotation    Special
  359.   hi link vimNumber    Number
  360.   hi link vimOper    Operator
  361.   hi link vimOption    PreProc
  362.   hi link vimPatSep    SpecialChar
  363.   hi link vimPattern    Type
  364.   hi link vimRegister    SpecialChar
  365.   hi link vimSpecFile    Identifier
  366.   hi link vimSpecial    Type
  367.   hi link vimStatement    Statement
  368.   hi link vimString    String
  369.   hi link vimTermSet    StorageClass
  370.   hi link vimTodo    Todo
  371. endif
  372.  
  373. let b:current_syntax = "vim"
  374.  
  375. " vim: ts=17
  376.