xref: /vim-8.2.3635/runtime/syntax/dot.vim (revision 89bcfda6)
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
75command -nargs=+ HiLink hi def link <args>
76
77HiLink dotParErr	 Error
78HiLink dotBraceErr	 Error
79HiLink dotBrackErr	 Error
80
81HiLink dotComment	 Comment
82HiLink dotTodo	 Todo
83
84HiLink dotParEncl	 Keyword
85HiLink dotBrackEncl	 Keyword
86HiLink dotBraceEncl	 Keyword
87
88HiLink dotKeyword	 Keyword
89HiLink dotType	 Type
90HiLink dotKeyChar	 Keyword
91
92HiLink dotString	 String
93HiLink dotIdentifier	 Identifier
94
95delcommand HiLink
96
97let b:current_syntax = "dot"
98
99" vim: ts=8
100