neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

dot.vim (4493B)


      1 " Language:     Dot
      2 " Filenames:    *.dot
      3 " Maintainer:   Markus Mottl  <markus.mottl@gmail.com>
      4 " URL:          http://www.ocaml.info/vim/syntax/dot.vim
      5 " Last Change:  2021 Mar 24 - better attr + escape string matching, new keywords (Farbod Salamat-Zadeh)
      6 "               2011 May 17 - improved identifier matching + two new keywords
      7 "               2001 May 04 - initial version
      8 
      9 " For version 5.x: Clear all syntax items
     10 " For version 6.x: Quit when a syntax file was already loaded
     11 if version < 600
     12  syntax clear
     13 elseif exists("b:current_syntax")
     14  finish
     15 endif
     16 
     17 let s:keepcpo = &cpo
     18 set cpo&vim
     19 
     20 " Errors
     21 syn match    dotParErr     ")"
     22 syn match    dotBrackErr   "]"
     23 syn match    dotBraceErr   "}"
     24 
     25 " Enclosing delimiters
     26 syn region   dotEncl transparent matchgroup=dotParEncl start="(" matchgroup=dotParEncl end=")" contains=ALLBUT,dotParErr
     27 syn region   dotEncl transparent matchgroup=dotBrackEncl start="\[" matchgroup=dotBrackEncl end="\]" contains=ALLBUT,dotBrackErr
     28 syn region   dotEncl transparent matchgroup=dotBraceEncl start="{" matchgroup=dotBraceEncl end="}" contains=ALLBUT,dotBraceErr
     29 
     30 " Comments
     31 syn region   dotComment start="//" end="$" contains=dotComment,dotTodo
     32 syn region   dotComment start="/\*" end="\*/" contains=dotComment,dotTodo
     33 syn keyword  dotTodo contained TODO FIXME XXX
     34 
     35 " Strings
     36 syn region   dotString    start=+"+ skip=+\\\\\|\\"+ end=+"+
     37 
     38 " Escape strings
     39 syn match    dotEscString /\v\\(N|G|E|T|H|L)/ containedin=dotString
     40 syn match    dotEscString /\v\\(n|l|r)/       containedin=dotString
     41 
     42 " General keywords
     43 syn keyword  dotKeyword graph digraph subgraph node edge strict
     44 
     45 " Node, edge and graph attributes
     46 syn keyword  dotType _background area arrowhead arrowsize arrowtail bb bgcolor
     47      \ center charset class clusterrank color colorscheme comment compound
     48      \ concentrate constraint Damping decorate defaultdist dim dimen dir
     49      \ diredgeconstraints distortion dpi edgehref edgetarget edgetooltip
     50      \ edgeURL epsilon esep fillcolor fixedsize fontcolor fontname fontnames
     51      \ fontpath fontsize forcelabels gradientangle group head_lp headclip
     52      \ headhref headlabel headport headtarget headtooltip headURL height href
     53      \ id image imagepath imagepos imagescale inputscale K label label_scheme
     54      \ labelangle labeldistance labelfloat labelfontcolor labelfontname
     55      \ labelfontsize labelhref labeljust labelloc labeltarget labeltooltip
     56      \ labelURL landscape layer layerlistsep layers layerselect layersep 
     57      \ layout len levels levelsgap lhead lheight lp ltail lwidth margin
     58      \ maxiter mclimit mindist minlen mode model mosek newrank nodesep 
     59      \ nojustify normalize notranslate nslimit nslimit1 ordering orientation
     60      \ outputorder overlap overlap_scaling overlap_shrink pack packmode pad
     61      \ page pagedir pencolor penwidth peripheries pin pos quadtree quantum
     62      \ rank rankdir ranksep ratio rects regular remincross repulsiveforce
     63      \ resolution root rotate rotation samehead sametail samplepoints scale
     64      \ searchsize sep shape shapefile showboxes sides size skew smoothing
     65      \ sortv splines start style stylesheet tail_lp tailclip tailhref 
     66      \ taillabel tailport tailtarget tailtooltip tailURL target tooltip
     67      \ truecolor URL vertices viewport voro_margin weight width xdotversion 
     68      \ xlabel xlp z
     69 
     70 " Special chars
     71 syn match    dotKeyChar  "="
     72 syn match    dotKeyChar  ";"
     73 syn match    dotKeyChar  "->"
     74 syn match    dotKeyChar  "--"
     75 
     76 " Identifier
     77 syn match    dotIdentifier /\<\w\+\(:\w\+\)\?\>/
     78 
     79 " Synchronization
     80 syn sync minlines=50
     81 syn sync maxlines=500
     82 
     83 " Define the default highlighting.
     84 " For version 5.7 and earlier: only when not done already
     85 " For version 5.8 and later: only when an item doesn't have highlighting yet
     86 if version >= 508 || !exists("did_dot_syntax_inits")
     87  if version < 508
     88    let did_dot_syntax_inits = 1
     89    command -nargs=+ HiLink hi link <args>
     90  else
     91    command -nargs=+ HiLink hi def link <args>
     92  endif
     93 
     94  HiLink dotParErr	 Error
     95  HiLink dotBraceErr	 Error
     96  HiLink dotBrackErr	 Error
     97 
     98  HiLink dotComment	 Comment
     99  HiLink dotTodo	 Todo
    100 
    101  HiLink dotParEncl	 Keyword
    102  HiLink dotBrackEncl	 Keyword
    103  HiLink dotBraceEncl	 Keyword
    104 
    105  HiLink dotKeyword	 Keyword
    106  HiLink dotType	 Type
    107  HiLink dotKeyChar	 Keyword
    108 
    109  HiLink dotString	 String
    110  HiLink dotEscString	 Keyword
    111  HiLink dotIdentifier	 Identifier
    112 
    113  delcommand HiLink
    114 endif
    115 
    116 let b:current_syntax = "dot"
    117 
    118 let &cpo = s:keepcpo
    119 unlet s:keepcpo
    120 
    121 " vim: ts=8