robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:46cc91e: runtime(privoxy): Update syntax fileeb875aca25

master
5.3 KiB183 linesraw
1" Vim syntax file
2" Language:	Privoxy actions file
3" Maintainer:	Doug Kearns <dougkearns@gmail.com>
4" Last Change:	2026 Jan 07
5
6" Privoxy 4.1.0
7
8if exists("b:current_syntax")
9  finish
10endif
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15syn region privoxyActionsBlock matchgroup=privoxyBraces start="^\s*\zs{" end="}"
16	\ contains=@privoxyActionPrefix,privoxyLineContinuation
17
18" Actions {{{
19let s:actions =<< trim END
20  add-header
21  block
22  change-x-forwarded-for
23  client-header-filter
24  client-body-filter
25  client-body-tagger
26  client-header-tagger
27  content-type-overwrite
28  crunch-client-header
29  crunch-if-none-match
30  crunch-incoming-cookies
31  crunch-outgoing-cookies
32  crunch-server-header
33  deanimate-gifs
34  delay-response
35  downgrade-http-version
36  external-filter
37  fast-redirects
38  filter
39  filter-client-headers
40  filter-server-headers
41  force-text-mode
42  forward-override
43  handle-as-empty-document
44  handle-as-image
45  hide-accept-language
46  hide-content-disposition
47  hide-forwarded-for-headers
48  hide-from-header
49  hide-if-modified-since
50  hide-referrer
51  hide-referer
52  hide-user-agent
53  https-inspection
54  ignore-certificate-errors
55  limit-connect
56  limit-cookie-lifetime
57  prevent-compression
58  prevent-keeping-cookies
59  overwrite-last-modified
60  redirect
61  server-header-filter
62  server-header-tagger
63  suppress-tag
64  session-cookies-only
65  set-image-blocker
66END
67
68for s:action in s:actions
69  exe 'syn match privoxyAction "\<' .. s:action .. '\>" contained nextgroup=privoxyParams'
70endfor
71unlet s:action s:actions
72
73syn region privoxyParams matchgroup=privoxyParamBraces start="{" end="}" contained
74
75syn match privoxyFilterAction "\<filter\>-\@!" contained nextgroup=privoxyFilterParams
76syn region privoxyFilterParams matchgroup=privoxyParamBraces start="{" end="}" contained contains=privoxyFilterArg
77
78syn cluster privoxyAction contains=privoxyAction,privoxyFilterAction
79" }}}
80
81" Filters {{{
82let s:filters =<< trim END
83      allow-autocompletion
84      all-popups
85      banners-by-link
86      banners-by-size
87      blogspot
88      bundeswehr
89      content-cookies
90      crude-parental
91      demoronizer
92      frameset-borders
93      fun
94      github
95      google
96      html-annoyances
97      ie-exploits
98      iframes
99      imdb
100      img-reorder
101      js-annoyances
102      js-events
103      jumping-windows
104      msn
105      no-ping
106      quicktime-kioskmode
107      refresh-tags
108      shockwave-flash
109      site-specifics
110      sourceforge
111      tiny-textforms
112      unsolicited-popups
113      webbugs
114      yahoo
115      x-httpd-php-to-html
116      html-to-xml
117      xml-to-html
118      less-download-windows
119      privoxy-control
120      hide-tor-exit-notation
121      no-brotli-accepted
122      privoxy-control
123      remove-first-byte
124      remove-test
125      overwrite-test-value
126END
127
128for s:filter in s:filters
129  exe 'syn match privoxyFilterArg "\<' .. s:filter .. '\>" contained"'
130endfor
131unlet s:filter s:filters
132" }}}
133
134syn match privoxyEnablePrefix  "\%(^\|\s\|{\)\@1<=+\l\@=" nextgroup=privoxy.*Action contained
135syn match privoxyDisablePrefix "\%(^\|\s\|{\)\@1<=-\l\@=" nextgroup=privoxy.*Action contained
136syn cluster privoxyActionPrefix contains=privoxyDisablePrefix,privoxyEnablePrefix
137
138syn match privoxySettingsHeader    "^\s*\zs{{settings\}}"    contains=privoxyBraces nextgroup=privoxySettingsSection skipnl skipwhite
139syn match privoxyDescriptionHeader "^\s*\zs{{description\}}" contains=privoxyBraces nextgroup=privoxyDescriptionSection skipnl
140syn match privoxyAliasHeader	   "^\s*\zs{{alias\}}"	     contains=privoxyBraces nextgroup=privoxyAliasSection skipnl
141
142syn region privoxySettingsSection    start="." end="^\s*\ze{" contained contains=privoxyComment,privoxySettingName
143syn region privoxyDescriptionSection start="." end="^\s*\ze{" contained
144syn region privoxyAliasSection	     start="." end="^\s*\ze{" contained contains=privoxyComment,privoxyAliasName
145
146syn match privoxySettingName "\<[a-z][a-z-]*" contained nextgroup=privoxySettingEqual
147syn match privoxySettingEqual "="	      contained nextgroup=privoxySettingValue
148syn match privoxySettingValue ".*"	      contained
149
150syn match privoxyAliasName "[+-]\<[a-z][a-z-]*"	contained nextgroup=privoxyAliasEqual skipwhite
151syn match privoxyAliasEqual "="			contained nextgroup=privoxyAliasValue skipwhite
152syn region privoxyAliasValue start="\S" skip="\\$" end="$" contained contains=@privoxyAction,@privoxyActionPrefix,privoxyLineContinuation
153
154syn match privoxyBraces		  "[{}]" contained
155syn match privoxyLineContinuation "\\$"  contained
156
157syn keyword privoxyTodo	   TODO FIXME XXX NOTE contained
158syn match   privoxyComment "#.*" contains=privoxyTodo,@Spell
159
160hi def link privoxyAction		Identifier
161hi def link privoxyAliasEqual		Operator
162hi def link privoxyAliasHeader		Title
163hi def link privoxyBraces		Delimiter
164hi def link privoxyComment		Comment
165hi def link privoxyDescriptionHeader	Title
166hi def link privoxyDisablePrefix	Added
167hi def link privoxyEnablePrefix		Removed
168hi def link privoxyFilterAction		privoxyAction
169hi def link privoxyFilterArg		Constant
170hi def link privoxyLineContinuation	Special
171hi def link privoxyParamBraces		privoxyBraces
172hi def link privoxySettingEqual		Operator
173hi def link privoxySettingName		Keyword
174hi def link privoxySettingsHeader	Title
175hi def link privoxySettingValue		Constant
176hi def link privoxyTodo			Todo
177
178let b:current_syntax = "privoxy"
179
180let &cpo = s:cpo_save
181unlet s:cpo_save
182
183" vim: ts=8 fdm=marker