1" Vim syntax file
2" Language:	Squid config file
3" Maintainer:	Klaus Muth <klaus@hampft.de>
4" Last Change:	2005 Jun 12
5" URL:		http://www.hampft.de/vim/syntax/squid.vim
6" ThanksTo:	Ilya Sher <iso8601@mail.ru>,
7"               Michael Dotzler <Michael.Dotzler@leoni.com>
8
9
10" For version 5.x: Clear all syntax items
11" For version 6.x: Quit when a syntax file was already loaded
12if version < 600
13  syntax clear
14elseif exists("b:current_syntax")
15  finish
16endif
17
18" squid.conf syntax seems to be case insensitive
19syn case ignore
20
21syn keyword	squidTodo	contained TODO
22syn match	squidComment	"#.*$" contains=squidTodo,squidTag
23syn match	squidTag	contained "TAG: .*$"
24
25" Lots & lots of Keywords!
26syn keyword	squidConf	acl always_direct announce_host announce_period
27syn keyword	squidConf	announce_port announce_to anonymize_headers
28syn keyword	squidConf	append_domain as_whois_server auth_param_basic
29syn keyword	squidConf	authenticate_children authenticate_program
30syn keyword	squidConf	authenticate_ttl broken_posts buffered_logs
31syn keyword	squidConf	cache_access_log cache_announce cache_dir
32syn keyword	squidConf	cache_dns_program cache_effective_group
33syn keyword	squidConf	cache_effective_user cache_host cache_host_acl
34syn keyword	squidConf	cache_host_domain cache_log cache_mem
35syn keyword	squidConf	cache_mem_high cache_mem_low cache_mgr
36syn keyword	squidConf	cachemgr_passwd cache_peer cache_peer_access
37syn keyword	squidConf	cahce_replacement_policy cache_stoplist
38syn keyword	squidConf	cache_stoplist_pattern cache_store_log cache_swap
39syn keyword	squidConf	cache_swap_high cache_swap_log cache_swap_low
40syn keyword	squidConf	client_db client_lifetime client_netmask
41syn keyword	squidConf	connect_timeout coredump_dir dead_peer_timeout
42syn keyword	squidConf	debug_options delay_access delay_class
43syn keyword	squidConf	delay_initial_bucket_level delay_parameters
44syn keyword	squidConf	delay_pools deny_info dns_children dns_defnames
45syn keyword	squidConf	dns_nameservers dns_testnames emulate_httpd_log
46syn keyword	squidConf	err_html_text fake_user_agent firewall_ip
47syn keyword	squidConf	forwarded_for forward_snmpd_port fqdncache_size
48syn keyword	squidConf	ftpget_options ftpget_program ftp_list_width
49syn keyword	squidConf	ftp_passive ftp_user half_closed_clients
50syn keyword	squidConf	header_access header_replace hierarchy_stoplist
51syn keyword	squidConf	high_response_time_warning high_page_fault_warning
52syn keyword	squidConf	htcp_port http_access http_anonymizer httpd_accel
53syn keyword	squidConf	httpd_accel_host httpd_accel_port
54syn keyword	squidConf	httpd_accel_uses_host_header
55syn keyword	squidConf	httpd_accel_with_proxy http_port http_reply_access
56syn keyword	squidConf	icp_access icp_hit_stale icp_port
57syn keyword	squidConf	icp_query_timeout ident_lookup ident_lookup_access
58syn keyword	squidConf	ident_timeout incoming_http_average
59syn keyword	squidConf	incoming_icp_average inside_firewall ipcache_high
60syn keyword	squidConf	ipcache_low ipcache_size local_domain local_ip
61syn keyword	squidConf	logfile_rotate log_fqdn log_icp_queries
62syn keyword	squidConf	log_mime_hdrs maximum_object_size
63syn keyword	squidConf	maximum_single_addr_tries mcast_groups
64syn keyword	squidConf	mcast_icp_query_timeout mcast_miss_addr
65syn keyword	squidConf	mcast_miss_encode_key mcast_miss_port memory_pools
66syn keyword	squidConf	memory_pools_limit memory_replacement_policy
67syn keyword	squidConf	mime_table min_http_poll_cnt min_icp_poll_cnt
68syn keyword	squidConf	minimum_direct_hops minimum_object_size
69syn keyword	squidConf	minimum_retry_timeout miss_access negative_dns_ttl
70syn keyword	squidConf	negative_ttl neighbor_timeout neighbor_type_domain
71syn keyword	squidConf	netdb_high netdb_low netdb_ping_period
72syn keyword	squidConf	netdb_ping_rate never_direct no_cache
73syn keyword	squidConf	passthrough_proxy pconn_timeout pid_filename
74syn keyword	squidConf	pinger_program positive_dns_ttl prefer_direct
75syn keyword	squidConf	proxy_auth proxy_auth_realm query_icmp quick_abort
76syn keyword	squidConf	quick_abort quick_abort_max quick_abort_min
77syn keyword	squidConf	quick_abort_pct range_offset_limit read_timeout
78syn keyword	squidConf	redirect_children redirect_program
79syn keyword	squidConf	redirect_rewrites_host_header reference_age
80syn keyword	squidConf	reference_age refresh_pattern reload_into_ims
81syn keyword	squidConf	request_body_max_size request_size request_timeout
82syn keyword	squidConf	shutdown_lifetime single_parent_bypass
83syn keyword	squidConf	siteselect_timeout snmp_access
84syn keyword	squidConf	snmp_incoming_address snmp_port source_ping
85syn keyword	squidConf	ssl_proxy store_avg_object_size
86syn keyword	squidConf	store_objects_per_bucket strip_query_terms
87syn keyword	squidConf	swap_level1_dirs swap_level2_dirs
88syn keyword	squidConf	tcp_incoming_address tcp_outgoing_address
89syn keyword	squidConf	tcp_recv_bufsize test_reachability udp_hit_obj
90syn keyword	squidConf	udp_hit_obj_size udp_incoming_address
91syn keyword	squidConf	udp_outgoing_address unique_hostname
92syn keyword	squidConf	unlinkd_program uri_whitespace useragent_log
93syn keyword	squidConf	visible_hostname wais_relay wais_relay_host
94syn keyword	squidConf	wais_relay_port
95
96syn keyword	squidOpt	proxy-only weight ttl no-query default
97syn keyword	squidOpt	round-robin multicast-responder
98syn keyword	squidOpt	on off all deny allow
99syn keyword	squidopt	via parent no-digest heap lru realm
100syn keyword	squidopt	children credentialsttl none disable
101syn keyword	squidopt	offline_toggle diskd q1 q2
102
103" Security Actions for cachemgr_passwd
104syn keyword	squidAction	shutdown info parameter server_list
105syn keyword	squidAction	client_list
106syn match	squidAction	"stats/\(objects\|vm_objects\|utilization\|ipcache\|fqdncache\|dns\|redirector\|io\|reply_headers\|filedescriptors\|netdb\)"
107syn match	squidAction	"log\(/\(status\|enable\|disable\|clear\)\)\="
108syn match	squidAction	"squid\.conf"
109
110" Keywords for the acl-config
111syn keyword	squidAcl	url_regex urlpath_regex referer_regex port proto
112syn keyword	squidAcl	req_mime_type rep_mime_type
113syn keyword	squidAcl	method browser user src dst
114syn keyword	squidAcl	time dstdomain ident snmp_community
115
116syn match	squidNumber	"\<\d\+\>"
117syn match	squidIP		"\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\>"
118syn match	squidStr	"\(^\s*acl\s\+\S\+\s\+\(\S*_regex\|re[pq]_mime_type\|browser\|_domain\|user\)\+\s\+\)\@<=.*" contains=squidRegexOpt
119syn match	squidRegexOpt	contained "\(^\s*acl\s\+\S\+\s\+\S\+\(_regex\|_mime_type\)\s\+\)\@<=[-+]i\s\+"
120
121" All config is in one line, so this has to be sufficient
122" Make it fast like hell :)
123syn sync minlines=3
124
125" Define the default highlighting.
126" For version 5.7 and earlier: only when not done already
127" For version 5.8 and later: only when an item doesn't have highlighting yet
128if version >= 508 || !exists("did_squid_syntax_inits")
129  if version < 508
130    let did_squid_syntax_inits = 1
131    command -nargs=+ HiLink hi link <args>
132  else
133    command -nargs=+ HiLink hi def link <args>
134  endif
135
136  HiLink squidTodo	Todo
137  HiLink squidComment	Comment
138  HiLink squidTag	Special
139  HiLink squidConf	Keyword
140  HiLink squidOpt	Constant
141  HiLink squidAction	String
142  HiLink squidNumber	Number
143  HiLink squidIP	Number
144  HiLink squidAcl	Keyword
145  HiLink squidStr	String
146  HiLink squidRegexOpt	Special
147
148  delcommand HiLink
149endif
150
151let b:current_syntax = "squid"
152
153" vim: ts=8
154