summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/wget.vim
blob: 93206c200501409517e7b80afcd59a9cee3627b9 (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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
" Vim syntax file
" Language:	Wget configuration file (/etc/wgetrc ~/.wgetrc)
" Maintainer:	Doug Kearns <dougkearns@gmail.com>
" Last Change:	2023 Nov 05

" GNU Wget 1.21 built on linux-gnu.

if exists("b:current_syntax")
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn match wgetComment "#.*" contains=wgetTodo contained

syn keyword wgetTodo TODO NOTE FIXME XXX contained

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

syn case ignore

syn keyword wgetBoolean on off yes no	 contained
syn keyword wgetNumber	inf		 contained
syn match   wgetNumber "\<\d\+>"	 contained
syn match   wgetQuota  "\<\d\+[kmgt]\>"	 contained
syn match   wgetTime   "\<\d\+[smhdw]\>" contained

"{{{ Commands
let s:commands =<< trim EOL
  accept
  accept-regex
  add-host-dir
  adjust-extension
  always-rest
  ask-password
  auth-no-challenge
  background
  backup-converted
  backups
  base
  bind-address
  bind-dns-address
  body-data
  body-file
  ca-certificate
  ca-directory
  cache
  certificate
  certificate-type
  check-certificate
  choose-config
  ciphers
  compression
  connect-timeout
  content-disposition
  content-on-error
  continue
  convert-file-only
  convert-links
  cookies
  crl-file
  cut-dirs
  debug
  default-page
  delete-after
  dns-cache
  dns-servers
  dns-timeout
  dir-prefix
  dir-struct
  domains
  dot-bytes
  dots-in-line
  dot-spacing
  dot-style
  egd-file
  exclude-directories
  exclude-domains
  follow-ftp
  follow-tags
  force-html
  ftp-passwd
  ftp-password
  ftp-user
  ftp-proxy
  ftps-clear-data-connection
  ftps-fallback-to-ftp
  ftps-implicit
  ftps-resume-ssl
  hsts
  hsts-file
  ftp-stmlf
  glob
  header
  html-extension
  htmlify
  http-keep-alive
  http-passwd
  http-password
  http-proxy
  https-proxy
  https-only
  http-user
  if-modified-since
  ignore-case
  ignore-length
  ignore-tags
  include-directories
  inet4-only
  inet6-only
  input
  input-meta-link
  iri
  keep-bad-hash
  keep-session-cookies
  kill-longer
  limit-rate
  load-cookies
  locale
  local-encoding
  logfile
  login
  max-redirect
  metalink-index
  metalink-over-http
  method
  mirror
  netrc
  no-clobber
  no-config
  no-parent
  no-proxy
  numtries
  output-document
  page-requisites
  passive-ftp
  passwd
  password
  pinned-pubkey
  post-data
  post-file
  prefer-family
  preferred-location
  preserve-permissions
  private-key
  private-key-type
  progress
  protocol-directories
  proxy-passwd
  proxy-password
  proxy-user
  quiet
  quota
  random-file
  random-wait
  read-timeout
  rec-level
  recursive
  referer
  regex-type
  reject
  rejected-log
  reject-regex
  relative-only
  remote-encoding
  remove-listing
  report-speed
  restrict-file-names
  retr-symlinks
  retry-connrefused
  retry-on-host-error
  retry-on-http-error
  robots
  save-cookies
  save-headers
  secure-protocol
  server-response
  show-all-dns-entries
  show-progress
  simple-host-check
  span-hosts
  spider
  start-pos
  strict-comments
  sslcertfile
  sslcertkey
  timeout
  timestamping
  use-server-timestamps
  tries
  trust-server-names
  unlink
  use-askpass
  user
  use-proxy
  user-agent
  verbose
  wait
  wait-retry
  warc-cdx
  warc-cdx-dedup
  warc-compression
  warc-digests
  warc-file
  warc-header
  warc-keep-log
  warc-max-size
  warc-temp-dir
  wdebug
  xattr
EOL
"}}}

for cmd in s:commands
  exe 'syn match wgetCommand "\<' .. substitute(cmd, '-', '[-_]\\=', "g") .. '\>" nextgroup=wgetAssignmentOperator skipwhite contained'
endfor
unlet s:commands

syn case match

syn match wgetLineStart		 "^" nextgroup=wgetCommand,wgetComment skipwhite
syn match wgetAssignmentOperator "=" nextgroup=wgetString,wgetBoolean,wgetNumber,wgetQuota,wgetTime skipwhite contained

hi def link wgetAssignmentOperator Special
hi def link wgetBoolean		   Boolean
hi def link wgetCommand		   Identifier
hi def link wgetComment		   Comment
hi def link wgetNumber		   Number
hi def link wgetQuota		   Number
hi def link wgetString		   String
hi def link wgetTime		   Number
hi def link wgetTodo		   Todo

let b:current_syntax = "wget"

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: ts=8 fdm=marker: