robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
4ad30f775e
master
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 11if version < 600 12syntax clear 13elseif exists ( "b:current_syntax" ) 14finish 15endif 16 17let s: keepcpo = & cpo 18set cpo & vim 19 20" Errors 21syn match dotParErr ") " 22syn match dotBrackErr "] " 23syn match dotBraceErr "} " 24 25" Enclosing delimiters 26syn region dotEncl transparent matchgroup = dotParEncl start = "( "matchgroup = dotParEncl end = ") "contains = ALLBUT , dotParErr 27syn region dotEncl transparent matchgroup = dotBrackEncl start = "\[ "matchgroup = dotBrackEncl end = "\] "contains = ALLBUT , dotBrackErr 28syn region dotEncl transparent matchgroup = dotBraceEncl start = "{ "matchgroup = dotBraceEncl end = "} "contains = ALLBUT , dotBraceErr 29 30" Comments 31syn region dotComment start = "// "end = "$ "contains = dotComment , dotTodo 32syn region dotComment start = "/\* "end = "\*/ "contains = dotComment , dotTodo 33syn keyword dotTodo contained TODO FIXME XXX 34 35" Strings 36syn region dotString start = +" +skip = +\\\\\|\\" +end = +" + 37 38" Escape strings 39syn match dotEscString /\v\\(N|G|E|T|H|L) /containedin = dotString 40syn match dotEscString /\v\\(n|l|r) /containedin = dotString 41 42" General keywords 43syn keyword dotKeyword graph digraph subgraph node edge strict 44 45" Node, edge and graph attributes 46syn 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 71syn match dotKeyChar "= " 72syn match dotKeyChar "; " 73syn match dotKeyChar "-> " 74syn match dotKeyChar "-- " 75 76" Identifier 77syn match dotIdentifier /\<\w\+\(:\w\+\)\?\> / 78 79" Synchronization 80syn sync minlines= 50 81syn 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 86if version >= 508 || ! exists ( "did_dot_syntax_inits" ) 87if version < 508 88let did_dot_syntax_inits = 1 89command -nargs = + HiLink hi link <args> 90else 91command -nargs = + HiLink hi def link <args> 92endif 93 94HiLink dotParErr Error 95HiLink dotBraceErr Error 96HiLink dotBrackErr Error 97 98HiLink dotComment Comment 99HiLink dotTodo Todo 100 101HiLink dotParEncl Keyword 102HiLink dotBrackEncl Keyword 103HiLink dotBraceEncl Keyword 104 105HiLink dotKeyword Keyword 106HiLink dotType Type 107HiLink dotKeyChar Keyword 108 109HiLink dotString String 110HiLink dotEscString Keyword 111HiLink dotIdentifier Identifier 112 113delcommand HiLink 114endif 115 116let b: current_syntax = "dot" 117 118let & cpo = s: keepcpo 119unlet s: keepcpo 120 121" vim: ts=8