blob: a63c336f06419431c2a6bf42a2f857f0126fa520 [file] [log] [blame]
Bram Moolenaard899e512022-05-07 21:54:03 +01001" Vim syntax file
2" Language: Wget2 configuration file (/etc/wget2rc ~/.wget2rc)
3" Maintainer: Doug Kearns <dougkearns@gmail.com>
4" Last Change: 2022 Apr 28
5
6" GNU Wget2 2.0.0 - multithreaded metalink/file/website downloader
7
8if exists("b:current_syntax")
9 finish
10endif
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15syn match wgetComment "#.*$" contains=wgetTodo contained
16
17syn keyword wgetTodo TODO NOTE FIXME XXX contained
18
19syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
20syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline
21
22syn case ignore
23
24syn keyword wgetBoolean on off yes no y n contained
25syn keyword wgetNumber infinity inf contained
26
27syn match wgetNumber "\<\d\+>" contained
28syn match wgetQuota "\<\d\+[kmgt]\>" contained
29syn match wgetTime "\<\d\+[smhd]\>" contained
30
31"{{{ Commands
32let s:commands =<< trim EOL
33 accept
34 accept-regex
35 adjust-extension
36 append-output
37 ask-password
38 auth-no-challenge
39 background
40 backup-converted
41 backups
42 base
43 bind-address
44 bind-interface
45 body-data
46 body-file
47 ca-certificate
48 ca-directory
49 cache
50 certificate
51 certificate-type
52 check-certificate
53 check-hostname
54 chunk-size
55 clobber
56 compression
57 config
58 connect-timeout
59 content-disposition
60 content-on-error
61 continue
62 convert-file-only
63 convert-links
64 cookie-suffixes
65 cookies
66 crl-file
67 cut-dirs
68 cut-file-get-vars
69 cut-url-get-vars
70 debug
71 default-http-port
72 default-https-port
73 default-page
74 delete-after
75 directories
76 directory-prefix
77 dns-cache
78 dns-cache-preload
79 dns-timeout
80 domains
81 download-attr
82 egd-file
83 exclude-directories
84 exclude-domains
85 execute
86 filter-mime-type
87 filter-urls
88 follow-tags
89 force-atom
90 force-css
91 force-directories
92 force-html
93 force-metalink
94 force-progress
95 force-rss
96 force-sitemap
97 fsync-policy
98 gnupg-homedir
99 header
100 help
101 host-directories
102 hpkp
103 hpkp-file
104 hsts
105 hsts-file
106 hsts-preload
107 hsts-preload-file
108 html-extension
109 http-keep-alive
110 http-password
111 http-proxy
112 http-proxy-password
113 http-proxy-user
114 http-user
115 http2
116 http2-only
117 http2-request-window
118 https-enforce
119 https-only
120 https-proxy
121 hyperlink
122 if-modified-since
123 ignore-case
124 ignore-length
125 ignore-tags
126 include-directories
127 inet4-only
128 inet6-only
129 input-encoding
130 input-file
131 keep-extension
132 keep-session-cookies
133 level
134 limit-rate
135 list-plugins
136 load-cookies
137 local-db
138 local-encoding
139 local-plugin
140 max-redirect
141 max-threads
142 metalink
143 method
144 mirror
145 netrc
146 netrc-file
147 ocsp
148 ocsp-date
149 ocsp-file
150 ocsp-nonce
151 ocsp-server
152 ocsp-stapling
153 output-document
154 output-file
155 page-requisites
156 parent
157 password
158 plugin
159 plugin-dirs
160 plugin-help
161 plugin-opt
162 post-data
163 post-file
164 prefer-family
165 private-key
166 private-key-type
167 progress
168 protocol-directories
169 proxy
170 quiet
171 quota
172 random-file
173 random-wait
174 read-timeout
175 recursive
176 referer
177 regex-type
178 reject
179 reject-regex
180 remote-encoding
181 report-speed
182 restrict-file-names
183 retry-connrefused
184 retry-on-http-error
185 robots
186 save-content-on
187 save-cookies
188 save-headers
189 secure-protocol
190 server-response
191 signature-extensions
192 span-hosts
193 spider
194 start-pos
195 stats-dns
196 stats-ocsp
197 stats-server
198 stats-site
199 stats-tls
200 strict-comments
201 tcp-fastopen
202 timeout
203 timestamping
204 tls-false-start
205 tls-resume
206 tls-session-file
207 tries
208 trust-server-names
209 unlink
210 use-askpass
211 use-server-timestamps
212 user
213 user-agent
214 verbose
215 verify-save-failed
216 verify-sig
217 version
218 wait
219 waitretry
220 xattr
221EOL
222"}}}
223
224call map(s:commands, "substitute(v:val, '_', '[-_]\\\\=', 'g')")
225
226for cmd in s:commands
227 exe 'syn match wgetCommand "\<' . cmd . '\>" nextgroup=wgetAssignmentOperator skipwhite contained'
228endfor
229
230syn case match
231
232syn match wgetStart "^" nextgroup=wgetCommand,wgetComment skipwhite
233syn match wgetAssignmentOperator "=" nextgroup=wgetString,wgetBoolean,wgetNumber,wgetQuota,wgetTime skipwhite contained
234
235hi def link wgetAssignmentOperator Special
236hi def link wgetBoolean Boolean
237hi def link wgetCommand Identifier
238hi def link wgetComment Comment
239hi def link wgetNumber Number
240hi def link wgetQuota Number
241hi def link wgetString String
242hi def link wgetTime Number
243hi def link wgetTodo Todo
244
245let b:current_syntax = "wget"
246
247let &cpo = s:cpo_save
248unlet s:cpo_save
249
250" vim: ts=8 fdm=marker: