summaryrefslogtreecommitdiff
path: root/runtime/syntax/wget.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-08-03 18:35:36 +0200
committerBram Moolenaar <Bram@vim.org>2013-08-03 18:35:36 +0200
commit9d98fe9cae372d84d0b1f6b56eee4615c91b1307 (patch)
tree0f3f6df92038bc9f662e5027f5b05e51fc400bc8 /runtime/syntax/wget.vim
parentf40f4ab8df0bb52a2d5f684d961b7c932c30e5df (diff)
downloadvim-9d98fe9cae372d84d0b1f6b56eee4615c91b1307.zip
Update runtime files.
Diffstat (limited to 'runtime/syntax/wget.vim')
-rw-r--r--runtime/syntax/wget.vim345
1 files changed, 170 insertions, 175 deletions
diff --git a/runtime/syntax/wget.vim b/runtime/syntax/wget.vim
index de8f558f9..2587022f2 100644
--- a/runtime/syntax/wget.vim
+++ b/runtime/syntax/wget.vim
@@ -1,194 +1,189 @@
-" 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
+" Vim syntax file
+" Language: Wget configuration file (/etc/wgetrc ~/.wgetrc)
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2013 Jun 1
-" 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")
+if 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
+let s:cpo_save = &cpo
+set cpo&vim
-syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
-syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline
+syn match wgetComment "#.*$" contains=wgetTodo contained
-" 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 keyword wgetTodo TODO NOTE FIXME XXX contained
-syn match wgetNumber "\<\d\+\|inf\>" contained
-syn match wgetQuota "\<\d\+[kKmM]\?\>" contained
-syn match wgetTime "\<\d\+[smhdw]\>" contained
+syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
+syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline
syn case ignore
-syn keyword wgetValue default binary mega giga micro contained
+syn keyword wgetBoolean on off contained
+syn keyword wgetNumber inf contained
syn case match
-syn match wgetRestriction "\<\%(windows\|unix\)\%(,nocontrol\)\=\>" contained
-syn match wgetRestriction "\<nocontrol\>" contained
+syn match wgetNumber "\<\%(\d\+\|inf\)\>" contained
+syn match wgetQuota "\<\d\+[kKmM]\>" contained
+syn match wgetTime "\<\d\+[smhdw]\>" contained
+
+"{{{ Commands
+let s:commands = map([
+ \ "accept",
+ \ "add_hostdir",
+ \ "adjust_extension",
+ \ "always_rest",
+ \ "ask_password",
+ \ "auth_no_challenge",
+ \ "background",
+ \ "backup_converted",
+ \ "backups",
+ \ "base",
+ \ "bind_address",
+ \ "ca_certificate",
+ \ "ca_directory",
+ \ "cache",
+ \ "certificate",
+ \ "certificate_type",
+ \ "check_certificate",
+ \ "connect_timeout",
+ \ "content_disposition",
+ \ "continue",
+ \ "convert_links",
+ \ "cookies",
+ \ "cut_dirs",
+ \ "debug",
+ \ "default_page",
+ \ "delete_after",
+ \ "dns_cache",
+ \ "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",
+ \ "glob",
+ \ "header",
+ \ "html_extension",
+ \ "htmlify",
+ \ "http_keep_alive",
+ \ "http_passwd",
+ \ "http_password",
+ \ "http_proxy",
+ \ "https_proxy",
+ \ "http_user",
+ \ "ignore_case",
+ \ "ignore_length",
+ \ "ignore_tags",
+ \ "include_directories",
+ \ "inet4_only",
+ \ "inet6_only",
+ \ "input",
+ \ "iri",
+ \ "keep_session_cookies",
+ \ "kill_longer",
+ \ "limit_rate",
+ \ "load_cookies",
+ \ "locale",
+ \ "local_encoding",
+ \ "logfile",
+ \ "login",
+ \ "max_redirect",
+ \ "mirror",
+ \ "netrc",
+ \ "no_clobber",
+ \ "no_parent",
+ \ "no_proxy",
+ \ "numtries",
+ \ "output_document",
+ \ "page_requisites",
+ \ "passive_ftp",
+ \ "passwd",
+ \ "password",
+ \ "post_data",
+ \ "post_file",
+ \ "prefer_family",
+ \ "preserve_permissions",
+ \ "private_key",
+ \ "private_key_type",
+ \ "progress",
+ \ "protocol_directories",
+ \ "proxy_passwd",
+ \ "proxy_password",
+ \ "proxy_user",
+ \ "quiet",
+ \ "quota",
+ \ "random_file",
+ \ "random_wait",
+ \ "read_timeout",
+ \ "reclevel",
+ \ "recursive",
+ \ "referer",
+ \ "reject",
+ \ "relative_only",
+ \ "remote_encoding",
+ \ "remove_listing",
+ \ "restrict_file_names",
+ \ "retr_symlinks",
+ \ "retry_connrefused",
+ \ "robots",
+ \ "save_cookies",
+ \ "save_headers",
+ \ "secure_protocol",
+ \ "server_response",
+ \ "show_all_dns_entries",
+ \ "simple_host_check",
+ \ "span_hosts",
+ \ "spider",
+ \ "strict_comments",
+ \ "sslcertfile",
+ \ "sslcertkey",
+ \ "timeout",
+ \ "time_stamping",
+ \ "use_server_timestamps",
+ \ "tries",
+ \ "trust_server_names",
+ \ "user",
+ \ "use_proxy",
+ \ "user_agent",
+ \ "verbose",
+ \ "wait",
+ \ "wait_retry"],
+ \ "substitute(v:val, '_', '[-_]\\\\=', 'g')")
+"}}}
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
+for cmd in s:commands
+ exe 'syn match wgetCommand "' . cmd . '" nextgroup=wgetAssignmentOperator skipwhite contained'
+endfor
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
+syn match wgetStart "^" nextgroup=wgetCommand,wgetComment skipwhite
+syn match wgetAssignmentOperator "=" nextgroup=wgetString,wgetBoolean,wgetNumber,wgetQuota,wgetTime skipwhite contained
- 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
+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 wgetTodo Todo
let b:current_syntax = "wget"
-" vim: ts=8
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ts=8 fdm=marker: