annotate runtime/syntax/dot.vim @ 27:a01d8d9b2a58 first-working-version

first working version.
author kono
date Mon, 27 Oct 2008 18:28:11 +0900
parents 76efa0be13f1
children 67300faee616
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
1 " Vim syntax file
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
2 " Language: Dot
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 " Filenames: *.dot
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 " Maintainer: Markus Mottl <markus.mottl@gmail.com>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5 " URL: http://www.ocaml.info/vim/syntax/dot.vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6 " Last Change: 2006 Feb 05
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7 " 2001 May 04 - initial version
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9 " For version 5.x: Clear all syntax items
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10 " For version 6.x: Quit when a syntax file was already loaded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 if version < 600
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 syntax clear
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 elseif exists("b:current_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 finish
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17 " Errors
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18 syn match dotParErr ")"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 syn match dotBrackErr "]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20 syn match dotBraceErr "}"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22 " Enclosing delimiters
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23 syn region dotEncl transparent matchgroup=dotParEncl start="(" matchgroup=dotParEncl end=")" contains=ALLBUT,dotParErr
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24 syn region dotEncl transparent matchgroup=dotBrackEncl start="\[" matchgroup=dotBrackEncl end="\]" contains=ALLBUT,dotBrackErr
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25 syn region dotEncl transparent matchgroup=dotBraceEncl start="{" matchgroup=dotBraceEncl end="}" contains=ALLBUT,dotBraceErr
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
27 " Comments
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
28 syn region dotComment start="//" end="$" contains=dotComment,dotTodo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
29 syn region dotComment start="/\*" end="\*/" contains=dotComment,dotTodo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 syn keyword dotTodo contained TODO FIXME XXX
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32 " Strings
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33 syn region dotString start=+"+ skip=+\\\\\|\\"+ end=+"+
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35 " General keywords
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 syn keyword dotKeyword digraph node edge subgraph
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 " Graph attributes
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39 syn keyword dotType center layers margin mclimit name nodesep nslimit
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40 syn keyword dotType ordering page pagedir rank rankdir ranksep ratio
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41 syn keyword dotType rotate size
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 " Node attributes
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44 syn keyword dotType distortion fillcolor fontcolor fontname fontsize
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45 syn keyword dotType height layer orientation peripheries regular
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 syn keyword dotType shape shapefile sides skew width
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 " Edge attributes
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49 syn keyword dotType arrowhead arrowsize arrowtail constraint decorateP
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50 syn keyword dotType dir headclip headlabel labelangle labeldistance
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51 syn keyword dotType labelfontcolor labelfontname labelfontsize
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 syn keyword dotType minlen port_label_distance samehead sametail
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 syn keyword dotType tailclip taillabel weight
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55 " Shared attributes (graphs, nodes, edges)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 syn keyword dotType color
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 " Shared attributes (graphs and edges)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 syn keyword dotType bgcolor label URL
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61 " Shared attributes (nodes and edges)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62 syn keyword dotType fontcolor fontname fontsize layer style
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
64 " Special chars
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
65 syn match dotKeyChar "="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
66 syn match dotKeyChar ";"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
67 syn match dotKeyChar "->"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
68
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
69 " Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
70 syn match dotIdentifier /\<\w\+\>/
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
71
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
72 " Synchronization
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
73 syn sync minlines=50
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
74 syn sync maxlines=500
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
75
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
76 " Define the default highlighting.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
77 " For version 5.7 and earlier: only when not done already
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
78 " For version 5.8 and later: only when an item doesn't have highlighting yet
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
79 if version >= 508 || !exists("did_dot_syntax_inits")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
80 if version < 508
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
81 let did_dot_syntax_inits = 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
82 command -nargs=+ HiLink hi link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
83 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
84 command -nargs=+ HiLink hi def link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
85 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
86
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
87 HiLink dotParErr Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
88 HiLink dotBraceErr Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
89 HiLink dotBrackErr Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
90
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
91 HiLink dotComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
92 HiLink dotTodo Todo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
93
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
94 HiLink dotParEncl Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
95 HiLink dotBrackEncl Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
96 HiLink dotBraceEncl Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
97
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
98 HiLink dotKeyword Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
99 HiLink dotType Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
100 HiLink dotKeyChar Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
101
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
102 HiLink dotString String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
103 HiLink dotIdentifier Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
104
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
105 delcommand HiLink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
106 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
107
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
108 let b:current_syntax = "dot"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
109
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
110 " vim: ts=8