summaryrefslogtreecommitdiff
path: root/runtime/syntax/wget.vim
blob: de8f558f9c27b0c415273767c68b1690c8bf5001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
" Wget syntax file
" Filename:     wget.vim
" Language:     Wget configuration file ( /etc/wgetrc ~/.wgetrc )
" Maintainer:   Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL:          http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/wget.vim
" Last Change:  2005 Jul 24

" TODO: all commands are actually underscore and hyphen insensitive, though
"       they are normally named as listed below

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

syn match   wgetComment "^\s*#.*$" contains=wgetTodo

syn keyword wgetTodo TODO NOTE FIXME XXX contained

syn match   wgetAssignment "^\s*[A-Za-z0-9_-]\+\s*=\s*.*$" contains=wgetCommand,wgetAssignmentOperator,wgetString,wgetBoolean,wgetNumber,wgetValue,wgetQuota,wgetRestriction,wgetTime

syn match   wgetAssignmentOperator "=" contained

syn region  wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
syn region  wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline

" Note: make this a match so that always_rest matches properly
syn case ignore
syn match   wgetBoolean	"\<on\|off\|always\|never\|1\|0\>" contained
syn case match

syn match   wgetNumber	"\<\d\+\|inf\>"		contained
syn match   wgetQuota	"\<\d\+[kKmM]\?\>"	contained
syn match   wgetTime	"\<\d\+[smhdw]\>"	contained

syn case ignore
syn keyword wgetValue	default binary mega giga micro contained
syn case match

syn match   wgetRestriction  "\<\%(windows\|unix\)\%(,nocontrol\)\=\>"	contained
syn match   wgetRestriction  "\<nocontrol\>"				contained

syn case ignore
syn match wgetCommand "^\s*accept" contained
syn match wgetCommand "^\s*add[-_]\=hostdir" contained
syn match wgetCommand "^\s*always[-_]\=rest" contained
syn match wgetCommand "^\s*background" contained
syn match wgetCommand "^\s*backup[-_]\=converted" contained
syn match wgetCommand "^\s*backups" contained
syn match wgetCommand "^\s*base" contained
syn match wgetCommand "^\s*bind[-_]\=address" contained
syn match wgetCommand "^\s*ca[-_]\=certificate" contained
syn match wgetCommand "^\s*ca[-_]\=directory" contained
syn match wgetCommand "^\s*cache" contained
syn match wgetCommand "^\s*certificate" contained
syn match wgetCommand "^\s*certificate[-_]\=type" contained
syn match wgetCommand "^\s*check[-_]\=certificate" contained
syn match wgetCommand "^\s*connect[-_]\=timeout" contained
syn match wgetCommand "^\s*continue" contained
syn match wgetCommand "^\s*convert[-_]\=links" contained
syn match wgetCommand "^\s*cookies" contained
syn match wgetCommand "^\s*cut[-_]\=dirs" contained
syn match wgetCommand "^\s*debug" contained
syn match wgetCommand "^\s*delete[-_]\=after" contained
syn match wgetCommand "^\s*dns[-_]\=cache" contained
syn match wgetCommand "^\s*dns[-_]\=timeout" contained
syn match wgetCommand "^\s*dir[-_]\=prefix" contained
syn match wgetCommand "^\s*dir[-_]\=struct" contained
syn match wgetCommand "^\s*domains" contained
syn match wgetCommand "^\s*dot[-_]\=bytes" contained
syn match wgetCommand "^\s*dots[-_]\=in[-_]\=line" contained
syn match wgetCommand "^\s*dot[-_]\=spacing" contained
syn match wgetCommand "^\s*dot[-_]\=style" contained
syn match wgetCommand "^\s*egd[-_]\=file" contained
syn match wgetCommand "^\s*exclude[-_]\=directories" contained
syn match wgetCommand "^\s*exclude[-_]\=domains" contained
syn match wgetCommand "^\s*follow[-_]\=ftp" contained
syn match wgetCommand "^\s*follow[-_]\=tags" contained
syn match wgetCommand "^\s*force[-_]\=html" contained
syn match wgetCommand "^\s*ftp[-_]\=passw\(or\)\=d" contained
syn match wgetCommand "^\s*ftp[-_]\=user" contained
syn match wgetCommand "^\s*ftp[-_]\=proxy" contained
syn match wgetCommand "^\s*glob" contained
syn match wgetCommand "^\s*header" contained
syn match wgetCommand "^\s*html[-_]\=extension" contained
syn match wgetCommand "^\s*htmlify" contained
syn match wgetCommand "^\s*http[-_]\=keep[-_]\=alive" contained
syn match wgetCommand "^\s*http[-_]\=passwd" contained
syn match wgetCommand "^\s*http[-_]\=password" contained
syn match wgetCommand "^\s*http[-_]\=proxy" contained
syn match wgetCommand "^\s*https[-_]\=proxy" contained
syn match wgetCommand "^\s*http[-_]\=user" contained
syn match wgetCommand "^\s*ignore[-_]\=length" contained
syn match wgetCommand "^\s*ignore[-_]\=tags" contained
syn match wgetCommand "^\s*include[-_]\=directories" contained
syn match wgetCommand "^\s*inet4[-_]\=only" contained
syn match wgetCommand "^\s*inet6[-_]\=only" contained
syn match wgetCommand "^\s*input" contained
syn match wgetCommand "^\s*keep[-_]\=session[-_]\=cookies" contained
syn match wgetCommand "^\s*kill[-_]\=longer" contained
syn match wgetCommand "^\s*limit[-_]\=rate" contained
syn match wgetCommand "^\s*load[-_]\=cookies" contained
syn match wgetCommand "^\s*logfile" contained
syn match wgetCommand "^\s*login" contained
syn match wgetCommand "^\s*mirror" contained
syn match wgetCommand "^\s*netrc" contained
syn match wgetCommand "^\s*no[-_]\=clobber" contained
syn match wgetCommand "^\s*no[-_]\=parent" contained
syn match wgetCommand "^\s*no[-_]\=proxy" contained
" Note: this option is deprecated, use 'tries' instead
syn match wgetCommand "^\s*numtries" contained
syn match wgetCommand "^\s*output[-_]\=document" contained
syn match wgetCommand "^\s*page[-_]\=requisites" contained
syn match wgetCommand "^\s*passive[-_]\=ftp" contained
syn match wgetCommand "^\s*passwd" contained
syn match wgetCommand "^\s*password" contained
syn match wgetCommand "^\s*post[-_]\=data" contained
syn match wgetCommand "^\s*post[-_]\=file" contained
syn match wgetCommand "^\s*prefer[-_]\=family" contained
syn match wgetCommand "^\s*preserve[-_]\=permissions" contained
syn match wgetCommand "^\s*private[-_]\=key" contained
syn match wgetCommand "^\s*private[-_]\=key[-_]\=type" contained
syn match wgetCommand "^\s*progress" contained
syn match wgetCommand "^\s*protocol[-_]\=directories" contained
syn match wgetCommand "^\s*proxy[-_]\=passwd" contained
syn match wgetCommand "^\s*proxy[-_]\=password" contained
syn match wgetCommand "^\s*proxy[-_]\=user" contained
syn match wgetCommand "^\s*quiet" contained
syn match wgetCommand "^\s*quota" contained
syn match wgetCommand "^\s*random[-_]\=file" contained
syn match wgetCommand "^\s*random[-_]\=wait" contained
syn match wgetCommand "^\s*read[-_]\=timeout" contained
syn match wgetCommand "^\s*reclevel" contained
syn match wgetCommand "^\s*recursive" contained
syn match wgetCommand "^\s*referer" contained
syn match wgetCommand "^\s*reject" contained
syn match wgetCommand "^\s*relative[-_]\=only" contained
syn match wgetCommand "^\s*remove[-_]\=listing" contained
syn match wgetCommand "^\s*restrict[-_]\=file[-_]\=names" contained
syn match wgetCommand "^\s*retr[-_]\=symlinks" contained
syn match wgetCommand "^\s*retry[-_]\=connrefused" contained
syn match wgetCommand "^\s*robots" contained
syn match wgetCommand "^\s*save[-_]\=cookies" contained
syn match wgetCommand "^\s*save[-_]\=headers" contained
syn match wgetCommand "^\s*secure[-_]\=protocol" contained
syn match wgetCommand "^\s*server[-_]\=response" contained
" Note: this option was removed in wget 1.8
syn match wgetCommand "^\s*simple[-_]\=host[-_]\=check" contained
syn match wgetCommand "^\s*span[-_]\=hosts" contained
syn match wgetCommand "^\s*spider" contained
syn match wgetCommand "^\s*strict[-_]\=comments" contained
syn match wgetCommand "^\s*sslcertfile" contained
syn match wgetCommand "^\s*sslcertkey" contained
syn match wgetCommand "^\s*timeout" contained
syn match wgetCommand "^\s*time[-_]\=stamping" contained
syn match wgetCommand "^\s*tries" contained
syn match wgetCommand "^\s*user" contained
syn match wgetCommand "^\s*use[-_]\=proxy" contained
syn match wgetCommand "^\s*user[-_]\=agent" contained
syn match wgetCommand "^\s*verbose" contained
syn match wgetCommand "^\s*wait" contained
syn match wgetCommand "^\s*wait[-_]\=retry" contained
syn case match

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_wget_syn_inits")
  if version < 508
    let did_wget_syn_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink wgetAssignmentOperator Special
  HiLink wgetBoolean            Boolean
  HiLink wgetCommand            Identifier
  HiLink wgetComment            Comment
  HiLink wgetNumber             Number
  HiLink wgetQuota              Number
  HiLink wgetString             String
  HiLink wgetTodo               Todo
  HiLink wgetValue              Constant

  delcommand HiLink
endif

let b:current_syntax = "wget"

" vim: ts=8