xref: /vim-8.2.3635/runtime/syntax/dot.vim (revision 5f1920ad)
1" Vim syntax file
2" Language:     Dot
3" Filenames:    *.dot
4" Maintainer:   Markus Mottl  <[email protected]>
5" URL:          http://www.ocaml.info/vim/syntax/dot.vim
6" Last Change:  2011 May 17 - improved identifier matching + two new keywords
7"               2001 May 04 - initial version
8
9" quit when a syntax file was already loaded
10if exists("b:current_syntax")
11  finish
12endif
13
14" Errors
15syn match    dotParErr     ")"
16syn match    dotBrackErr   "]"
17syn match    dotBraceErr   "}"
18
19" Enclosing delimiters
20syn region   dotEncl transparent matchgroup=dotParEncl start="(" matchgroup=dotParEncl end=")" contains=ALLBUT,dotParErr
21syn region   dotEncl transparent matchgroup=dotBrackEncl start="\[" matchgroup=dotBrackEncl end="\]" contains=ALLBUT,dotBrackErr
22syn region   dotEncl transparent matchgroup=dotBraceEncl start="{" matchgroup=dotBraceEncl end="}" contains=ALLBUT,dotBraceErr
23
24" Comments
25syn region   dotComment start="//" end="$" contains=dotComment,dotTodo
26syn region   dotComment start="/\*" end="\*/" contains=dotComment,dotTodo
27syn keyword  dotTodo contained TODO FIXME XXX
28
29" Strings
30syn region   dotString    start=+"+ skip=+\\\\\|\\"+ end=+"+
31
32" General keywords
33syn keyword  dotKeyword  digraph node edge subgraph
34
35" Graph attributes
36syn keyword  dotType center layers margin mclimit name nodesep nslimit
37syn keyword  dotType ordering page pagedir rank rankdir ranksep ratio
38syn keyword  dotType rotate size
39
40" Node attributes
41syn keyword  dotType distortion fillcolor fontcolor fontname fontsize
42syn keyword  dotType height layer orientation peripheries regular
43syn keyword  dotType shape shapefile sides skew width
44
45" Edge attributes
46syn keyword  dotType arrowhead arrowsize arrowtail constraint decorateP
47syn keyword  dotType dir headclip headlabel headport labelangle labeldistance
48syn keyword  dotType labelfontcolor labelfontname labelfontsize
49syn keyword  dotType minlen port_label_distance samehead sametail
50syn keyword  dotType tailclip taillabel tailport weight
51
52" Shared attributes (graphs, nodes, edges)
53syn keyword  dotType color
54
55" Shared attributes (graphs and edges)
56syn keyword  dotType bgcolor label URL
57
58" Shared attributes (nodes and edges)
59syn keyword  dotType fontcolor fontname fontsize layer style
60
61" Special chars
62syn match    dotKeyChar  "="
63syn match    dotKeyChar  ";"
64syn match    dotKeyChar  "->"
65
66" Identifier
67syn match    dotIdentifier /\<\w\+\(:\w\+\)\?\>/
68
69" Synchronization
70syn sync minlines=50
71syn sync maxlines=500
72
73" Define the default highlighting.
74" Only when an item doesn't have highlighting yet
75
76hi def link dotParErr	 Error
77hi def link dotBraceErr	 Error
78hi def link dotBrackErr	 Error
79
80hi def link dotComment	 Comment
81hi def link dotTodo	 Todo
82
83hi def link dotParEncl	 Keyword
84hi def link dotBrackEncl	 Keyword
85hi def link dotBraceEncl	 Keyword
86
87hi def link dotKeyword	 Keyword
88hi def link dotType	 Type
89hi def link dotKeyChar	 Keyword
90
91hi def link dotString	 String
92hi def link dotIdentifier	 Identifier
93
94
95let b:current_syntax = "dot"
96
97" vim: ts=8
98