robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
eb875aca25
master
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" ) 9finish 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 20add-header 21block 22change-x-forwarded-for 23client-header-filter 24client-body-filter 25client-body-tagger 26client-header-tagger 27content-type-overwrite 28crunch-client-header 29crunch-if-none-match 30crunch-incoming-cookies 31crunch-outgoing-cookies 32crunch-server-header 33deanimate-gifs 34delay-response 35downgrade-http-version 36external-filter 37fast-redirects 38filter 39filter-client-headers 40filter-server-headers 41force-text-mode 42forward-override 43handle-as-empty-document 44handle-as-image 45hide-accept-language 46hide-content-disposition 47hide-forwarded-for-headers 48hide-from-header 49hide-if-modified-since 50hide-referrer 51hide-referer 52hide-user-agent 53https-inspection 54ignore-certificate-errors 55limit-connect 56limit-cookie-lifetime 57prevent-compression 58prevent-keeping-cookies 59overwrite-last-modified 60redirect 61server-header-filter 62server-header-tagger 63suppress-tag 64session-cookies-only 65set-image-blocker 66END 67 68for s: action in s: actions 69exe '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 83allow-autocompletion 84all-popups 85banners-by-link 86banners-by-size 87blogspot 88bundeswehr 89content-cookies 90crude-parental 91demoronizer 92frameset-borders 93fun 94github 95html-annoyances 97ie-exploits 98iframes 99imdb 100img-reorder 101js-annoyances 102js-events 103jumping-windows 104msn 105no-ping 106quicktime-kioskmode 107refresh-tags 108shockwave-flash 109site-specifics 110sourceforge 111tiny-textforms 112unsolicited-popups 113webbugs 114yahoo 115x-httpd-php-to-html 116html-to-xml 117xml-to-html 118less-download-windows 119privoxy-control 120hide-tor-exit-notation 121no-brotli-accepted 122privoxy-control 123remove-first-byte 124remove-test 125overwrite-test-value 126END 127 128for s: filter in s: filters 129exe '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