xref: /vim-8.2.3635/runtime/syntax/muttrc.vim (revision cb03397a)
1" Vim syntax file
2" Language:	Mutt setup files
3" Original:	Preben 'Peppe' Guldberg <[email protected]>
4" Maintainer:	Kyle Wheeler <[email protected]>
5" Last Change:	18 August 2016
6
7" This file covers mutt version 1.7.0
8
9" For version 5.x: Clear all syntax items
10" For version 6.x: Quit when a syntax file was already loaded
11if version < 600
12  syntax clear
13elseif exists("b:current_syntax")
14  finish
15endif
16
17let s:cpo_save = &cpo
18set cpo&vim
19
20" Set the keyword characters
21if version < 600
22  set isk=@,48-57,_,-
23else
24  setlocal isk=@,48-57,_,-
25endif
26
27" handling optional variables
28if !exists("use_mutt_sidebar")
29  let use_mutt_sidebar=0
30endif
31
32syn match muttrcComment		"^# .*$" contains=@Spell
33syn match muttrcComment		"^#[^ ].*$"
34syn match muttrcComment		"^#$"
35syn match muttrcComment		"[^\\]#.*$"lc=1
36
37" Escape sequences (back-tick and pipe goes here too)
38syn match muttrcEscape		+\\[#tnr"'Cc ]+
39syn match muttrcEscape		+[`|]+
40syn match muttrcEscape		+\\$+
41
42" The variables takes the following arguments
43"syn match  muttrcString		contained "=\s*[^ #"'`]\+"lc=1 contains=muttrcEscape
44syn region muttrcString		contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString
45syn region muttrcString		contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction
46syn match muttrcStringNL	contained skipwhite skipnl "\s*\\$" nextgroup=muttrcString,muttrcStringNL
47
48syn region muttrcShellString	matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand
49
50syn match  muttrcRXChars	contained /[^\\][][.*?+]\+/hs=s+1
51syn match  muttrcRXChars	contained /[][|()][.*?+]*/
52syn match  muttrcRXChars	contained /['"]^/ms=s+1
53syn match  muttrcRXChars	contained /$['"]/me=e-1
54syn match  muttrcRXChars	contained /\\/
55" Why does muttrcRXString2 work with one \ when muttrcRXString requires two?
56syn region muttrcRXString	contained skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars
57syn region muttrcRXString	contained skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars
58syn region muttrcRXString	contained skipwhite start=+[^ 	"'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars
59" For some reason, skip refuses to match backslashes here...
60syn region muttrcRXString	contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXChars
61syn region muttrcRXString	contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXChars
62syn region muttrcRXString2	contained skipwhite start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars
63syn region muttrcRXString2	contained skipwhite start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars
64
65" these must be kept synchronized with muttrcRXString, but are intended for
66" muttrcRXHooks
67syn region muttrcRXHookString	contained keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
68syn region muttrcRXHookString	contained keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
69syn region muttrcRXHookString	contained keepend skipwhite start=+[^ 	"'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
70syn region muttrcRXHookString	contained keepend skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
71syn region muttrcRXHookString	contained keepend matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
72syn match muttrcRXHookStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL
73
74" these are exclusively for args lists (e.g. -rx pat pat pat ...)
75syn region muttrcRXPat		contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat
76syn region muttrcRXPat		contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat
77syn match muttrcRXPat		contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat
78syn match muttrcRXDef 		contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat
79
80syn match muttrcSpecial		+\(['"]\)!\1+
81
82syn match muttrcSetStrAssignment contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable
83syn region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString
84syn region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString
85syn match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable
86syn match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
87syn match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
88syn match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
89syn match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable
90syn match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
91syn match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
92syn match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
93syn match muttrcSetNumAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable
94syn match muttrcSetNumAssignment contained skipwhite /=\s*\d\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
95syn match muttrcSetNumAssignment contained skipwhite /=\s*"\d\+"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
96syn match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
97
98" Now catch some email addresses and headers (purified version from mail.vim)
99syn match muttrcEmail		"[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+"
100syn match muttrcHeader		"\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\="
101
102syn match   muttrcKeySpecial	contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+
103syn match   muttrcKey		contained "\S\+"			contains=muttrcKeySpecial,muttrcKeyName
104syn region  muttrcKey		contained start=+"+ skip=+\\\\\|\\"+ end=+"+	contains=muttrcKeySpecial,muttrcKeyName
105syn region  muttrcKey		contained start=+'+ skip=+\\\\\|\\'+ end=+'+	contains=muttrcKeySpecial,muttrcKeyName
106syn match   muttrcKeyName	contained "\<f\%(\d\|10\)\>"
107syn match   muttrcKeyName	contained "\\[trne]"
108syn match   muttrcKeyName	contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>"
109syn match   muttrcKeyName	contained "<F[0-9]\+>"
110
111syn keyword muttrcVarBool	skipwhite contained
112			\ allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split
113			\ auto_tag autoedit beep beep_new bounce_delivered braille_friendly
114			\ check_mbox_size check_new collapse_unread confirmappend confirmcreate
115			\ crypt_autoencrypt crypt_autopgp crypt_autosign crypt_autosmime
116			\ crypt_confirmhook crypt_opportunistic_encrypt crypt_replyencrypt
117			\ crypt_replysign crypt_replysignencrypted crypt_timestamp crypt_use_gpgme
118			\ crypt_use_pka delete_untag digest_collapse duplicate_threads edit_hdrs
119			\ edit_headers encode_from envelope_from fast_reply fcc_clear followup_to
120			\ force_name forw_decode forw_decrypt forw_quote forward_decode forward_decrypt
121			\ forward_quote hdrs header help hidden_host hide_limited hide_missing
122			\ hide_thread_subject hide_top_limited hide_top_missing honor_disposition
123			\ idn_decode idn_encode ignore_linear_white_space ignore_list_reply_to
124			\ imap_check_subscribed imap_list_subscribed imap_passive imap_peek
125			\ imap_servernoise implicit_autoview include_onlyfirst keep_flagged
126			\ mail_check_recent mail_check_stats mailcap_sanitize maildir_check_cur
127			\ maildir_header_cache_verify maildir_trash mark_old markers menu_move_off
128			\ menu_scroll message_cache_clean meta_key metoo mh_purge mime_forward_decode
129			\ narrow_tree pager_stop pgp_auto_decode pgp_auto_traditional pgp_autoencrypt
130			\ pgp_autoinline pgp_autosign pgp_check_exit pgp_create_traditional
131			\ pgp_ignore_subkeys pgp_long_ids pgp_replyencrypt pgp_replyinline pgp_replysign
132			\ pgp_replysignencrypted pgp_retainable_sigs pgp_show_unusable pgp_strict_enc
133			\ pgp_use_gpg_agent pipe_decode pipe_split pop_auth_try_all pop_last
134			\ postpone_encrypt postpone_encrypt_as print_decode print_split prompt_after
135			\ read_only reflow_space_quotes reflow_text reflow_wrap reply_self resolve
136			\ resume_draft_files resume_edited_draft_files reverse_alias reverse_name
137			\ reverse_realname rfc2047_parameters save_address save_empty save_name score
138			\ sidebar_folder_indent sidebar_new_mail_only sidebar_next_new_wrap
139			\ sidebar_short_path sidebar_sort sidebar_visible sig_dashes sig_on_top
140			\ smart_wrap smime_ask_cert_label smime_decrypt_use_default_key smime_is_default
141			\ sort_re ssl_force_tls ssl_use_sslv2 ssl_use_sslv3 ssl_use_tlsv1
142			\ ssl_usesystemcerts ssl_verify_dates ssl_verify_host status_on_top strict_mime
143			\ strict_threads suspend text_flowed thorough_search thread_received tilde
144			\ ts_enabled uncollapse_jump use_8bitmime use_domain use_envelope_from use_from
145			\ use_idn use_ipv6 user_agent wait_key weed wrap_search write_bcc
146			\ nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
147
148syn keyword muttrcVarBool	skipwhite contained
149			\ noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc noaskcc noattach_split
150			\ noauto_tag noautoedit nobeep nobeep_new nobounce_delivered nobraille_friendly
151			\ nocheck_mbox_size nocheck_new nocollapse_unread noconfirmappend noconfirmcreate
152			\ nocrypt_autoencrypt nocrypt_autopgp nocrypt_autosign nocrypt_autosmime
153			\ nocrypt_confirmhook nocrypt_opportunistic_encrypt nocrypt_replyencrypt
154			\ nocrypt_replysign nocrypt_replysignencrypted nocrypt_timestamp nocrypt_use_gpgme
155			\ nocrypt_use_pka nodelete_untag nodigest_collapse noduplicate_threads noedit_hdrs
156			\ noedit_headers noencode_from noenvelope_from nofast_reply nofcc_clear nofollowup_to
157			\ noforce_name noforw_decode noforw_decrypt noforw_quote noforward_decode noforward_decrypt
158			\ noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nohide_missing
159			\ nohide_thread_subject nohide_top_limited nohide_top_missing nohonor_disposition
160			\ noidn_decode noidn_encode noignore_linear_white_space noignore_list_reply_to
161			\ noimap_check_subscribed noimap_list_subscribed noimap_passive noimap_peek
162			\ noimap_servernoise noimplicit_autoview noinclude_onlyfirst nokeep_flagged
163			\ nomail_check_recent nomail_check_stats nomailcap_sanitize nomaildir_check_cur
164			\ nomaildir_header_cache_verify nomaildir_trash nomark_old nomarkers nomenu_move_off
165			\ nomenu_scroll nomessage_cache_clean nometa_key nometoo nomh_purge nomime_forward_decode
166			\ nonarrow_tree nopager_stop nopgp_auto_decode nopgp_auto_traditional nopgp_autoencrypt
167			\ nopgp_autoinline nopgp_autosign nopgp_check_exit nopgp_create_traditional
168			\ nopgp_ignore_subkeys nopgp_long_ids nopgp_replyencrypt nopgp_replyinline nopgp_replysign
169			\ nopgp_replysignencrypted nopgp_retainable_sigs nopgp_show_unusable nopgp_strict_enc
170			\ nopgp_use_gpg_agent nopipe_decode nopipe_split nopop_auth_try_all nopop_last
171			\ nopostpone_encrypt nopostpone_encrypt_as noprint_decode noprint_split noprompt_after
172			\ noread_only noreflow_space_quotes noreflow_text noreflow_wrap noreply_self noresolve
173			\ noresume_draft_files noresume_edited_draft_files noreverse_alias noreverse_name
174			\ noreverse_realname norfc2047_parameters nosave_address nosave_empty nosave_name noscore
175			\ nosidebar_folder_indent nosidebar_new_mail_only nosidebar_next_new_wrap
176			\ nosidebar_short_path nosidebar_sort nosidebar_visible nosig_dashes nosig_on_top
177			\ nosmart_wrap nosmime_ask_cert_label nosmime_decrypt_use_default_key nosmime_is_default
178			\ nosort_re nossl_force_tls nossl_use_sslv2 nossl_use_sslv3 nossl_use_tlsv1
179			\ nossl_usesystemcerts nossl_verify_dates nossl_verify_host nostatus_on_top nostrict_mime
180			\ nostrict_threads nosuspend notext_flowed nothorough_search nothread_received notilde
181			\ nots_enabled nouncollapse_jump nouse_8bitmime nouse_domain nouse_envelope_from nouse_from
182			\ nouse_idn nouse_ipv6 nouser_agent nowait_key noweed nowrap_search nowrite_bcc
183			\ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
184
185syn keyword muttrcVarBool	skipwhite contained
186			\ invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc invaskcc invattach_split
187			\ invauto_tag invautoedit invbeep invbeep_new invbounce_delivered invbraille_friendly
188			\ invcheck_mbox_size invcheck_new invcollapse_unread invconfirmappend invconfirmcreate
189			\ invcrypt_autoencrypt invcrypt_autopgp invcrypt_autosign invcrypt_autosmime
190			\ invcrypt_confirmhook invcrypt_opportunistic_encrypt invcrypt_replyencrypt
191			\ invcrypt_replysign invcrypt_replysignencrypted invcrypt_timestamp invcrypt_use_gpgme
192			\ invcrypt_use_pka invdelete_untag invdigest_collapse invduplicate_threads invedit_hdrs
193			\ invedit_headers invencode_from invenvelope_from invfast_reply invfcc_clear invfollowup_to
194			\ invforce_name invforw_decode invforw_decrypt invforw_quote invforward_decode invforward_decrypt
195			\ invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited invhide_missing
196			\ invhide_thread_subject invhide_top_limited invhide_top_missing invhonor_disposition
197			\ invidn_decode invidn_encode invignore_linear_white_space invignore_list_reply_to
198			\ invimap_check_subscribed invimap_list_subscribed invimap_passive invimap_peek
199			\ invimap_servernoise invimplicit_autoview invinclude_onlyfirst invkeep_flagged
200			\ invmail_check_recent invmail_check_stats invmailcap_sanitize invmaildir_check_cur
201			\ invmaildir_header_cache_verify invmaildir_trash invmark_old invmarkers invmenu_move_off
202			\ invmenu_scroll invmessage_cache_clean invmeta_key invmetoo invmh_purge invmime_forward_decode
203			\ invnarrow_tree invpager_stop invpgp_auto_decode invpgp_auto_traditional invpgp_autoencrypt
204			\ invpgp_autoinline invpgp_autosign invpgp_check_exit invpgp_create_traditional
205			\ invpgp_ignore_subkeys invpgp_long_ids invpgp_replyencrypt invpgp_replyinline invpgp_replysign
206			\ invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable invpgp_strict_enc
207			\ invpgp_use_gpg_agent invpipe_decode invpipe_split invpop_auth_try_all invpop_last
208			\ invpostpone_encrypt invpostpone_encrypt_as invprint_decode invprint_split invprompt_after
209			\ invread_only invreflow_space_quotes invreflow_text invreflow_wrap invreply_self invresolve
210			\ invresume_draft_files invresume_edited_draft_files invreverse_alias invreverse_name
211			\ invreverse_realname invrfc2047_parameters invsave_address invsave_empty invsave_name invscore
212			\ invsidebar_folder_indent invsidebar_new_mail_only invsidebar_next_new_wrap
213			\ invsidebar_short_path invsidebar_sort invsidebar_visible invsig_dashes invsig_on_top
214			\ invsmart_wrap invsmime_ask_cert_label invsmime_decrypt_use_default_key invsmime_is_default
215			\ invsort_re invssl_force_tls invssl_use_sslv2 invssl_use_sslv3 invssl_use_tlsv1
216			\ invssl_usesystemcerts invssl_verify_dates invssl_verify_host invstatus_on_top invstrict_mime
217			\ invstrict_threads invsuspend invtext_flowed invthorough_search invthread_received invtilde
218			\ invts_enabled invuncollapse_jump invuse_8bitmime invuse_domain invuse_envelope_from invuse_from
219			\ invuse_idn invuse_ipv6 invuser_agent invwait_key invweed invwrap_search invwrite_bcc
220			\ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
221
222syn keyword muttrcVarQuad	skipwhite contained
223			\ abort_nosubject abort_unmodified bounce copy crypt_verify_sig delete
224			\ fcc_attach forward_edit honor_followup_to include mime_forward
225			\ mime_forward_rest mime_fwd move pgp_mime_auto pgp_verify_sig pop_delete
226			\ pop_reconnect postpone print quit recall reply_to ssl_starttls
227			\ nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
228
229syn keyword muttrcVarQuad	skipwhite contained
230			\ noabort_nosubject noabort_unmodified nobounce nocopy nocrypt_verify_sig nodelete
231			\ nofcc_attach noforward_edit nohonor_followup_to noinclude nomime_forward
232			\ nomime_forward_rest nomime_fwd nomove nopgp_mime_auto nopgp_verify_sig nopop_delete
233			\ nopop_reconnect nopostpone noprint noquit norecall noreply_to nossl_starttls
234			\ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
235
236syn keyword muttrcVarQuad	skipwhite contained
237			\ invabort_nosubject invabort_unmodified invbounce invcopy invcrypt_verify_sig invdelete
238			\ invfcc_attach invforward_edit invhonor_followup_to invinclude invmime_forward
239			\ invmime_forward_rest invmime_fwd invmove invpgp_mime_auto invpgp_verify_sig invpop_delete
240			\ invpop_reconnect invpostpone invprint invquit invrecall invreply_to invssl_starttls
241			\ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
242
243syn keyword muttrcVarNum	skipwhite contained
244			\ connect_timeout history imap_keepalive imap_pipeline_depth mail_check
245			\ mail_check_stats_interval menu_context net_inc pager_context pager_index_lines
246			\ pgp_timeout pop_checkinterval read_inc save_history score_threshold_delete
247			\ score_threshold_flag score_threshold_read search_context sendmail_wait
248			\ sidebar_width sleep_time smime_timeout ssl_min_dh_prime_bits time_inc timeout
249			\ wrap wrap_headers wrapmargin write_inc
250			\ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
251
252syn match muttrcFormatErrors contained /%./
253
254syn match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVvWwXxYyZz+%]/
255syn match muttrcStrftimeEscapes contained /%E[cCxXyY]/
256syn match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/
257
258syn region muttrcIndexFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
259syn region muttrcIndexFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
260syn region muttrcQueryFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
261syn region muttrcAliasFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
262syn region muttrcAliasFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
263syn region muttrcAttachFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
264syn region muttrcAttachFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
265syn region muttrcComposeFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
266syn region muttrcComposeFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
267syn region muttrcFolderFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
268syn region muttrcFolderFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
269syn region muttrcMixFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
270syn region muttrcMixFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
271syn region muttrcPGPFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
272syn region muttrcPGPFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
273syn region muttrcPGPCmdFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
274syn region muttrcPGPCmdFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
275syn region muttrcStatusFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
276syn region muttrcStatusFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
277syn region muttrcPGPGetKeysFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
278syn region muttrcPGPGetKeysFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
279syn region muttrcSmimeFormatStr	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
280syn region muttrcSmimeFormatStr	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
281syn region muttrcStrftimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
282syn region muttrcStrftimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
283
284" The following info was pulled from hdr_format_str in hdrline.c
285syn match muttrcIndexFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[aAbBcCdDeEfFHilLmMnNOPsStTuvXyYZ%]/
286syn match muttrcIndexFormatEscapes contained /%[>|*]./
287syn match muttrcIndexFormatConditionals contained /%?[EFHlLMNOXyY]?/ nextgroup=muttrcFormatConditionals2
288" The following info was pulled from alias_format_str in addrbook.c
289syn match muttrcAliasFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[afnrt%]/
290" The following info was pulled from query_format_str in query.c
291syn match muttrcQueryFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[acent%]/
292syn match muttrcQueryFormatConditionals contained /%?[e]?/ nextgroup=muttrcFormatConditionals2
293" The following info was pulled from mutt_attach_fmt in recvattach.c
294syn match muttrcAttachFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CcDdefImMnQstTuX%]/
295syn match muttrcAttachFormatEscapes contained /%[>|*]./
296syn match muttrcAttachFormatConditionals contained /%?[CcdDefInmMQstTuX]?/ nextgroup=muttrcFormatConditionals2
297syn match muttrcFormatConditionals2 contained /[^?]*?/
298" The following info was pulled from compose_format_str in compose.c
299syn match muttrcComposeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ahlv%]/
300syn match muttrcComposeFormatEscapes contained /%[>|*]./
301" The following info was pulled from folder_format_str in browser.c
302syn match muttrcFolderFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CDdfFglNstu%]/
303syn match muttrcFolderFormatEscapes contained /%[>|*]./
304syn match muttrcFolderFormatConditionals contained /%?[N]?/
305" The following info was pulled from mix_entry_fmt in remailer.c
306syn match muttrcMixFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ncsa%]/
307syn match muttrcMixFormatConditionals contained /%?[ncsa]?/
308" The following info was pulled from crypt_entry_fmt in crypt-gpgme.c
309" and pgp_entry_fmt in pgpkey.c (note that crypt_entry_fmt supports
310" 'p', but pgp_entry_fmt does not).
311syn match muttrcPGPFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[nkualfctp%]/
312syn match muttrcPGPFormatConditionals contained /%?[nkualfct]?/
313" The following info was pulled from _mutt_fmt_pgp_command in
314" pgpinvoke.c
315syn match muttrcPGPCmdFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[pfsar%]/
316syn match muttrcPGPCmdFormatConditionals contained /%?[pfsar]?/ nextgroup=muttrcFormatConditionals2
317" The following info was pulled from status_format_str in status.c
318syn match muttrcStatusFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[bdfFhlLmMnopPrsStuvV%]/
319syn match muttrcStatusFormatEscapes contained /%[>|*]./
320syn match muttrcStatusFormatConditionals contained /%?[bdFlLmMnoptuV]?/ nextgroup=muttrcFormatConditionals2
321" This matches the documentation, but directly contradicts the code
322" (according to the code, this should be identical to the
323" muttrcPGPCmdFormatEscapes
324syn match muttrcPGPGetKeysFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[r%]/
325" The following info was pulled from _mutt_fmt_smime_command in
326" smime.c
327syn match muttrcSmimeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[Cciskaf%]/
328syn match muttrcSmimeFormatConditionals contained /%?[Cciskaf]?/ nextgroup=muttrcFormatConditionals2
329
330syn region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes
331syn region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
332syn region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes
333syn region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes
334syn region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
335
336syn keyword muttrcVarStr	contained skipwhite attribution index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt
337syn match muttrcVarEqualsIdxFmt contained skipwhite "=" nextgroup=muttrcIndexFormatStr
338syn keyword muttrcVarStr	contained skipwhite alias_format nextgroup=muttrcVarEqualsAliasFmt
339syn match muttrcVarEqualsAliasFmt contained skipwhite "=" nextgroup=muttrcAliasFormatStr
340syn keyword muttrcVarStr	contained skipwhite attach_format nextgroup=muttrcVarEqualsAttachFmt
341syn match muttrcVarEqualsAttachFmt contained skipwhite "=" nextgroup=muttrcAttachFormatStr
342syn keyword muttrcVarStr	contained skipwhite compose_format nextgroup=muttrcVarEqualsComposeFmt
343syn match muttrcVarEqualsComposeFmt contained skipwhite "=" nextgroup=muttrcComposeFormatStr
344syn keyword muttrcVarStr	contained skipwhite folder_format nextgroup=muttrcVarEqualsFolderFmt
345syn match muttrcVarEqualsFolderFmt contained skipwhite "=" nextgroup=muttrcFolderFormatStr
346syn keyword muttrcVarStr	contained skipwhite mix_entry_format nextgroup=muttrcVarEqualsMixFmt
347syn match muttrcVarEqualsMixFmt contained skipwhite "=" nextgroup=muttrcMixFormatStr
348syn keyword muttrcVarStr	contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt
349syn match muttrcVarEqualsPGPFmt contained skipwhite "=" nextgroup=muttrcPGPFormatStr
350syn keyword muttrcVarStr	contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFmt
351syn match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr
352syn keyword muttrcVarStr	contained skipwhite pgp_decode_command pgp_verify_command pgp_decrypt_command pgp_clearsign_command pgp_sign_command pgp_encrypt_sign_command pgp_encrypt_only_command pgp_import_command pgp_export_command pgp_verify_key_command pgp_list_secring_command pgp_list_pubring_command nextgroup=muttrcVarEqualsPGPCmdFmt
353syn match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr
354syn keyword muttrcVarStr	contained skipwhite ts_icon_format ts_status_format status_format nextgroup=muttrcVarEqualsStatusFmt
355syn match muttrcVarEqualsStatusFmt contained skipwhite "=" nextgroup=muttrcStatusFormatStr
356syn keyword muttrcVarStr	contained skipwhite pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt
357syn match muttrcVarEqualsPGPGetKeysFmt contained skipwhite "=" nextgroup=muttrcPGPGetKeysFormatStr
358syn keyword muttrcVarStr	contained skipwhite smime_decrypt_command smime_verify_command smime_verify_opaque_command smime_sign_command smime_sign_opaque_command smime_encrypt_command smime_pk7out_command smime_get_cert_command smime_get_signer_cert_command smime_import_cert_command smime_get_cert_email_command nextgroup=muttrcVarEqualsSmimeFmt
359syn match muttrcVarEqualsSmimeFmt contained skipwhite "=" nextgroup=muttrcSmimeFormatStr
360syn keyword muttrcVarStr	contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFmt
361syn match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=muttrcStrftimeFormatStr
362
363syn match muttrcVPrefix		contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
364
365syn match muttrcVarStr		contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
366syn keyword muttrcVarStr	contained skipwhite
367			\ alias_file assumed_charset attach_charset attach_sep certificate_file charset
368			\ config_charset content_type default_hook display_filter dotlock_program
369			\ dsn_notify dsn_return editor entropy_file envelope_from_address escape folder
370			\ forw_format forward_format from gecos_mask hdr_format header_cache
371			\ header_cache_compress header_cache_pagesize history_file hostname
372			\ imap_authenticators imap_delim_chars imap_headers imap_idle imap_login
373			\ imap_pass imap_user indent_str indent_string ispell locale mailcap_path mask
374			\ mbox mbox_type message_cachedir mh_seq_flagged mh_seq_replied mh_seq_unseen
375			\ mixmaster msg_format pager pgp_decryption_okay pgp_good_sign
376			\ pgp_mime_signature_description pgp_mime_signature_filename pgp_sign_as
377			\ pgp_sort_keys pipe_sep pop_authenticators pop_host pop_pass pop_user
378			\ post_indent_str post_indent_string postpone_encrypt_as postponed preconnect
379			\ print_cmd print_command query_command quote_regexp realname record
380			\ reply_regexp send_charset sendmail shell sidebar_delim sidebar_delim_chars
381			\ sidebar_divider_char sidebar_format sidebar_indent_string sidebar_sort_method
382			\ signature simple_search smileys smime_ca_location smime_certificates
383			\ smime_default_key smime_encrypt_with smime_keys smime_sign_as
384			\ smime_sign_digest_alg smtp_authenticators smtp_pass smtp_url sort sort_alias
385			\ sort_aux sort_browser spam_separator spoolfile ssl_ca_certificates_file
386			\ ssl_ciphers ssl_client_cert status_chars tmpdir to_chars trash ts_icon_format
387			\ ts_status_format tunnel visual
388			\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
389
390" Present in 1.4.2.1 (pgp_create_traditional was a bool then)
391syn keyword muttrcVarBool	contained skipwhite imap_force_ssl noimap_force_ssl invimap_force_ssl nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
392"syn keyword muttrcVarQuad	contained pgp_create_traditional nopgp_create_traditional invpgp_create_traditional
393syn keyword muttrcVarStr	contained skipwhite alternates nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
394
395syn keyword muttrcMenu		contained alias attach browser compose editor index pager postpone pgp mix query generic
396syn match muttrcMenuList "\S\+" contained contains=muttrcMenu
397syn match muttrcMenuCommas /,/ contained
398
399syn keyword muttrcHooks		contained skipwhite account-hook charset-hook iconv-hook message-hook folder-hook mbox-hook save-hook fcc-hook fcc-save-hook send-hook send2-hook reply-hook crypt-hook
400
401syn keyword muttrcCommand	skipwhite
402			\ alternative_order auto_view exec hdr_order iconv-hook ignore mailboxes
403			\ mailto_allow mime_lookup my_hdr pgp-hook push score sidebar_whitelist source
404			\ unalternative_order unalternative_order unauto_view ungroup unhdr_order
405			\ unignore unmailboxes unmailto_allow unmime_lookup unmono unmy_hdr unscore
406syn keyword muttrcCommand	skipwhite charset-hook nextgroup=muttrcRXString
407syn keyword muttrcCommand	skipwhite unhook nextgroup=muttrcHooks
408
409syn keyword muttrcCommand 	skipwhite spam nextgroup=muttrcSpamPattern
410syn region muttrcSpamPattern	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL
411syn region muttrcSpamPattern	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL
412
413syn keyword muttrcCommand 	skipwhite nospam nextgroup=muttrcNoSpamPattern
414syn region muttrcNoSpamPattern	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern
415syn region muttrcNoSpamPattern	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern
416
417syn match muttrcAttachmentsMimeType contained "[*a-z0-9_-]\+/[*a-z0-9._-]\+\s*" skipwhite nextgroup=muttrcAttachmentsMimeType
418syn match muttrcAttachmentsFlag contained "[+-]\%([AI]\|inline\|attachment\)\s\+" skipwhite nextgroup=muttrcAttachmentsMimeType
419syn match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite nextgroup=muttrcAttachmentsFlag
420
421syn match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)"
422
423syn keyword muttrcAsterisk	contained *
424syn keyword muttrcListsKeyword	lists skipwhite nextgroup=muttrcGroupDef,muttrcComment
425syn keyword muttrcListsKeyword	unlists skipwhite nextgroup=muttrcAsterisk,muttrcComment
426
427syn keyword muttrcSubscribeKeyword	subscribe nextgroup=muttrcGroupDef,muttrcComment
428syn keyword muttrcSubscribeKeyword	unsubscribe nextgroup=muttrcAsterisk,muttrcComment
429
430syn keyword muttrcAlternateKeyword contained alternates unalternates
431syn region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment
432
433" muttrcVariable includes a prefix because partial strings are considered
434" valid.
435syn match muttrcVariable	contained "\\\@<![a-zA-Z_-]*\$[a-zA-Z_-]\+" contains=muttrcVariableInner
436syn match muttrcVariableInner	contained "\$[a-zA-Z_-]\+"
437syn match muttrcEscapedVariable	contained "\\\$[a-zA-Z_-]\+"
438
439syn match muttrcBadAction	contained "[^<>]\+" contains=muttrcEmail
440syn match muttrcFunction	contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|purge\|recall\|resend\|save\|send\|tag\|undelete\)-message\>"
441syn match muttrcFunction	contained "\<\%(delete\|next\|previous\|read\|tag\|break\|undelete\)-thread\>"
442syn match muttrcFunction	contained "\<link-threads\>"
443syn match muttrcFunction	contained "\<\%(backward\|capitalize\|downcase\|forward\|kill\|upcase\)-word\>"
444syn match muttrcFunction	contained "\<\%(delete\|filter\|first\|last\|next\|pipe\|previous\|print\|save\|select\|tag\|undelete\)-entry\>"
445syn match muttrcFunction	contained "\<attach-\%(file\|key\)\>"
446syn match muttrcFunction	contained "\<change-\%(dir\|folder\|folder-readonly\)\>"
447syn match muttrcFunction	contained "\<check-\%(new\|traditional-pgp\)\>"
448syn match muttrcFunction	contained "\<current-\%(bottom\|middle\|top\)\>"
449syn match muttrcFunction	contained "\<decode-\%(copy\|save\)\>"
450syn match muttrcFunction	contained "\<delete-\%(char\|pattern\|subthread\)\>"
451syn match muttrcFunction	contained "\<display-\%(address\|toggle-weed\)\>"
452syn match muttrcFunction	contained "\<edit\%(-\%(bcc\|cc\|description\|encoding\|fcc\|file\|from\|headers\|mime\|reply-to\|subject\|to\|type\)\)\?\>"
453syn match muttrcFunction	contained "\<enter-\%(command\|mask\)\>"
454syn match muttrcFunction	contained "\<half-\%(up\|down\)\>"
455syn match muttrcFunction	contained "\<history-\%(up\|down\)\>"
456syn match muttrcFunction	contained "\<kill-\%(eol\|eow\|line\)\>"
457syn match muttrcFunction	contained "\<next-\%(line\|new\%(-then-unread\)\?\|page\|subthread\|undeleted\|unread\|unread-mailbox\)\>"
458syn match muttrcFunction	contained "\<previous-\%(line\|new\%(-then-unread\)\?\|page\|subthread\|undeleted\|unread\)\>"
459syn match muttrcFunction	contained "\<search\%(-\%(next\|opposite\|reverse\|toggle\)\)\?\>"
460syn match muttrcFunction	contained "\<show-\%(limit\|version\)\>"
461syn match muttrcFunction	contained "\<sort-\%(mailbox\|reverse\)\>"
462syn match muttrcFunction	contained "\<tag-\%(pattern\|\%(sub\)\?thread\|prefix\%(-cond\)\?\)\>"
463syn match muttrcFunction	contained "\<end-cond\>"
464syn match muttrcFunction	contained "\<sidebar-\%(next\|next-new\|open\|page-down\|page-up\|prev\|prev-new\|toggle-visible\)\>"
465syn match muttrcFunction	contained "\<toggle-\%(mailboxes\|new\|quoted\|subscribed\|unlink\|write\)\>"
466syn match muttrcFunction	contained "\<undelete-\%(pattern\|subthread\)\>"
467syn match muttrcFunction	contained "\<collapse-\%(parts\|thread\|all\)\>"
468syn match muttrcFunction	contained "\<view-\%(attach\|attachments\|file\|mailcap\|name\|text\)\>"
469syn match muttrcFunction	contained "\<\%(backspace\|backward-char\|bol\|bottom\|bottom-page\|buffy-cycle\|clear-flag\|complete\%(-query\)\?\|copy-file\|create-alias\|detach-file\|eol\|exit\|extract-keys\|\%(imap-\)\?fetch-mail\|forget-passphrase\|forward-char\|group-reply\|help\|ispell\|jump\|limit\|list-reply\|mail\|mail-key\|mark-as-new\|middle-page\|new-mime\|noop\|pgp-menu\|query\|query-append\|quit\|quote-char\|read-subthread\|redraw-screen\|refresh\|rename-file\|reply\|select-new\|set-flag\|shell-escape\|skip-quoted\|sort\|subscribe\|sync-mailbox\|top\|top-page\|transpose-chars\|unsubscribe\|untag-pattern\|verify-key\|what-key\|write-fcc\)\>"
470syn keyword muttrcFunction	contained imap-logout-all
471if use_mutt_sidebar == 1
472    syn match muttrcFunction    contained "\<sidebar-\%(prev\|next\|open\|scroll-up\|scroll-down\)"
473endif
474syn match muttrcAction		contained "<[^>]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName
475
476syn keyword muttrcCommand	set     skipwhite nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
477syn keyword muttrcCommand	unset   skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
478syn keyword muttrcCommand	reset   skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
479syn keyword muttrcCommand	toggle  skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
480
481" First, functions that take regular expressions:
482syn match  muttrcRXHookNot	contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL
483syn match  muttrcRXHooks	/\<\%(account\|folder\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL
484
485" Now, functions that take patterns
486syn match muttrcPatHookNot	contained /!\s*/ skipwhite nextgroup=muttrcPattern
487syn match muttrcPatHooks	/\<\%(mbox\|crypt\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern
488syn match muttrcPatHooks	/\<\%(message\|reply\|send\|send2\|save\|\|fcc\%(-save\)\?\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern
489
490syn match muttrcBindFunction	contained /\S\+\>/ skipwhite contains=muttrcFunction
491syn match muttrcBindFunctionNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL
492syn match muttrcBindKey		contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL
493syn match muttrcBindKeyNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindKey,muttrcBindKeyNL
494syn match muttrcBindMenuList	contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcBindKey,muttrcBindKeyNL
495syn match muttrcBindMenuListNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
496syn keyword muttrcCommand	skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
497
498syn region muttrcMacroDescr	contained keepend skipwhite start=+\s*\S+ms=e skip=+\\ + end=+ \|$+me=s
499syn region muttrcMacroDescr	contained keepend skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s
500syn region muttrcMacroDescr	contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s
501syn match muttrcMacroDescrNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
502syn region muttrcMacroBody	contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
503syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'\|\%(\%(\\\\\)\@<!$\)+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcSpam,muttrcNoSpam,muttrcCommand,muttrcAction,muttrcVariable nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
504syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+"+ms=e skip=+\\"+ end=+"\|\%(\%(\\\\\)\@<!$\)+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcSpam,muttrcNoSpam,muttrcCommand,muttrcAction,muttrcVariable nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
505syn match muttrcMacroBodyNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroBody,muttrcMacroBodyNL
506syn match muttrcMacroKey	contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcMacroBody,muttrcMacroBodyNL
507syn match muttrcMacroKeyNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroKey,muttrcMacroKeyNL
508syn match muttrcMacroMenuList	contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcMacroKey,muttrcMacroKeyNL
509syn match muttrcMacroMenuListNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL
510syn keyword muttrcCommand	skipwhite macro	nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL
511
512syn match muttrcAddrContent	contained "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+\s*" skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
513syn region muttrcAddrContent	contained start=+'+ end=+'\s*+ skip=+\\'+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
514syn region muttrcAddrContent	contained start=+"+ end=+"\s*+ skip=+\\"+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
515syn match muttrcAddrDef 	contained "-addr\s\+" skipwhite nextgroup=muttrcAddrContent
516
517syn match muttrcGroupFlag	contained "-group"
518syn region muttrcGroupDef	contained start="-group\s\+" skip="\\$" end="\s" skipwhite keepend contains=muttrcGroupFlag,muttrcUnHighlightSpace
519
520syn keyword muttrcGroupKeyword	contained group ungroup
521syn region muttrcGroupLine	keepend start=+^\s*\%(un\)\?group\s+ skip=+\\$+ end=+$+ contains=muttrcGroupKeyword,muttrcGroupDef,muttrcAddrDef,muttrcRXDef,muttrcUnHighlightSpace,muttrcComment
522
523syn match muttrcAliasGroupName	contained /\w\+/ skipwhite nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
524syn match muttrcAliasGroupDefNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL
525syn match muttrcAliasGroupDef	contained /\s*-group/ skipwhite nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL contains=muttrcGroupFlag
526syn match muttrcAliasComma	contained /,/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
527syn match muttrcAliasEmail	contained /\S\+@\S\+/ contains=muttrcEmail nextgroup=muttrcAliasName,muttrcAliasNameNL skipwhite
528syn match muttrcAliasEncEmail	contained /<[^>]\+>/ contains=muttrcEmail nextgroup=muttrcAliasComma
529syn match muttrcAliasEncEmailNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL
530syn match muttrcAliasNameNoParens contained /[^<(@]\+\s\+/ nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL
531syn region muttrcAliasName	contained matchgroup=Type start=/(/ end=/)/ skipwhite
532syn match muttrcAliasNameNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasName,muttrcAliasNameNL
533syn match muttrcAliasENNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
534syn match muttrcAliasKey	contained /\s*[^- \t]\S\+/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
535syn match muttrcAliasNL		contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
536syn keyword muttrcCommand	skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
537
538syn match muttrcUnAliasKey	contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
539syn match muttrcUnAliasNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
540syn keyword muttrcCommand	skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
541
542syn match muttrcSimplePat contained "!\?\^\?[~][ADEFgGklNOpPQRSTuUvV=$]"
543syn match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s*\%([<>-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)"
544syn match muttrcSimplePat contained "!\?\^\?[~][dr]\s*\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\|\%(`[^`]\+`\)\|\%(\$[a-zA-Z0-9_-]\+\)\)" contains=muttrcShellString,muttrcVariable
545syn match muttrcSimplePat contained "!\?\^\?[~][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatRXContainer
546syn match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString
547syn match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString
548syn region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat
549"syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXString
550syn region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+
551syn region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+
552syn region muttrcSimplePatString contained keepend start=+[^ 	"']+ skip=+\\ + end=+\s+re=e-1
553syn region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXString
554syn region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXString
555syn region muttrcSimplePatRXContainer contained keepend start=+[^ 	"']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString
556syn match muttrcSimplePatMetas contained /[(|)]/
557
558syn match muttrcOptSimplePat contained skipwhite /[~=%!(^].*/ contains=muttrcSimplePat,muttrcSimplePatMetas
559syn match muttrcOptSimplePat contained skipwhite /[^~=%!(^].*/ contains=muttrcRXString
560syn region muttrcOptPattern contained matchgroup=Type keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL
561syn region muttrcOptPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL
562syn region muttrcOptPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL
563syn match muttrcOptPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL
564syn match muttrcOptPattern contained skipwhite /[.]/ nextgroup=muttrcString,muttrcStringNL
565" Keep muttrcPattern and muttrcOptPattern synchronized
566syn region muttrcPattern contained matchgroup=Type keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
567syn region muttrcPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
568syn region muttrcPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat
569syn match muttrcPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat
570syn match muttrcPattern contained skipwhite /[.]/
571syn region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
572syn region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
573
574" Colour definitions takes object, foreground and background arguments (regexps excluded).
575syn match muttrcColorMatchCount	contained "[0-9]\+"
576syn match muttrcColorMatchCountNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
577syn region muttrcColorRXPat	contained start=+\s*'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
578syn region muttrcColorRXPat	contained start=+\s*"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
579syn keyword muttrcColorField	skipwhite contained
580			\ attachment body bold error hdrdefault header index indicator markers message
581			\ normal prompt quoted search sidebar-divider sidebar-flagged sidebar-highlight
582			\ sidebar-indicator sidebar-new sidebar-spoolfile signature status tilde tree
583			\ underline
584syn match   muttrcColorField	contained "\<quoted\d\=\>"
585if use_mutt_sidebar == 1
586    syn keyword muttrcColorField contained sidebar_new
587endif
588syn keyword muttrcColor	contained black blue cyan default green magenta red white yellow
589syn keyword muttrcColor	contained brightblack brightblue brightcyan brightdefault brightgreen brightmagenta brightred brightwhite brightyellow
590syn match   muttrcColor	contained "\<\%(bright\)\=color\d\{1,3}\>"
591" Now for the structure of the color line
592syn match muttrcColorRXNL	contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL
593syn match muttrcColorBG 	contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL
594syn match muttrcColorBGNL	contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL
595syn match muttrcColorFG 	contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL
596syn match muttrcColorFGNL	contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL
597syn match muttrcColorContext 	contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorFG,muttrcColorFGNL
598syn match muttrcColorNL 	contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL
599syn match muttrcColorKeyword	contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL
600syn region muttrcColorLine keepend start=/^\s*color\s\+\%(index\|header\)\@!/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace
601" Now for the structure of the color index line
602syn match muttrcPatternNL	contained skipnl "\s*\\$" nextgroup=muttrcPattern,muttrcPatternNL
603syn match muttrcColorBGI	contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcPattern,muttrcPatternNL
604syn match muttrcColorBGNLI	contained skipnl "\s*\\$" nextgroup=muttrcColorBGI,muttrcColorBGNLI
605syn match muttrcColorFGI	contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGI,muttrcColorBGNLI
606syn match muttrcColorFGNLI	contained skipnl "\s*\\$" nextgroup=muttrcColorFGI,muttrcColorFGNLI
607syn match muttrcColorContextI	contained /\s*\<index\>/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGI,muttrcColorFGNLI
608syn match muttrcColorNLI	contained skipnl "\s*\\$" nextgroup=muttrcColorContextI,muttrcColorNLI
609syn match muttrcColorKeywordI	contained skipwhite /\<color\>/ nextgroup=muttrcColorContextI,muttrcColorNLI
610syn region muttrcColorLine keepend skipwhite start=/\<color\s\+index\>/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordI,muttrcComment,muttrcUnHighlightSpace
611" Now for the structure of the color header line
612syn match muttrcRXPatternNL	contained skipnl "\s*\\$" nextgroup=muttrcRXString,muttrcRXPatternNL
613syn match muttrcColorBGH	contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcRXString,muttrcRXPatternNL
614syn match muttrcColorBGNLH	contained skipnl "\s*\\$" nextgroup=muttrcColorBGH,muttrcColorBGNLH
615syn match muttrcColorFGH	contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGH,muttrcColorBGNLH
616syn match muttrcColorFGNLH	contained skipnl "\s*\\$" nextgroup=muttrcColorFGH,muttrcColorFGNLH
617syn match muttrcColorContextH	contained /\s*\<header\>/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGH,muttrcColorFGNLH
618syn match muttrcColorNLH	contained skipnl "\s*\\$" nextgroup=muttrcColorContextH,muttrcColorNLH
619syn match muttrcColorKeywordH	contained skipwhite /\<color\>/ nextgroup=muttrcColorContextH,muttrcColorNLH
620syn region muttrcColorLine keepend skipwhite start=/\<color\s\+header\>/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordH,muttrcComment,muttrcUnHighlightSpace
621" And now color's brother:
622syn region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
623syn region muttrcUnColorPatterns contained skipwhite start=+\s*"+ end=+"+ skip=+\\"+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
624syn match muttrcUnColorPatterns contained skipwhite /\s*[^'"\s]\S\*/ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
625syn match muttrcUnColorPatNL	contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
626syn match muttrcUnColorAll	contained skipwhite /[*]/
627syn match muttrcUnColorAPNL	contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL
628syn match muttrcUnColorIndex	contained skipwhite /\s*index\s\+/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL
629syn match muttrcUnColorIndexNL	contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL
630syn match muttrcUnColorKeyword	contained skipwhite /^\s*uncolor\s\+/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL
631syn region muttrcUnColorLine keepend start=+^\s*uncolor\s+ skip=+\\$+ end=+$+ contains=muttrcUnColorKeyword,muttrcComment,muttrcUnHighlightSpace
632
633" Mono are almost like color (ojects inherited from color)
634syn keyword muttrcMonoAttrib	contained bold none normal reverse standout underline
635syn keyword muttrcMono		contained mono		skipwhite nextgroup=muttrcColorField
636syn match   muttrcMonoLine	"^\s*mono\s\+\S\+"	skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono
637
638" Define the default highlighting.
639" For version 5.7 and earlier: only when not done already
640" For version 5.8 and later: only when an item doesn't have highlighting yet
641if version >= 508 || !exists("did_muttrc_syntax_inits")
642  if version < 508
643    let did_muttrc_syntax_inits = 1
644    command -nargs=+ HiLink hi link <args>
645  else
646    command -nargs=+ HiLink hi def link <args>
647  endif
648
649  HiLink muttrcComment		Comment
650  HiLink muttrcEscape		SpecialChar
651  HiLink muttrcRXChars		SpecialChar
652  HiLink muttrcString		String
653  HiLink muttrcRXString		String
654  HiLink muttrcRXString2	String
655  HiLink muttrcSpecial		Special
656  HiLink muttrcHooks		Type
657  HiLink muttrcGroupFlag	Type
658  HiLink muttrcGroupDef		Macro
659  HiLink muttrcAddrDef		muttrcGroupFlag
660  HiLink muttrcRXDef		muttrcGroupFlag
661  HiLink muttrcRXPat		String
662  HiLink muttrcAliasGroupName	Macro
663  HiLink muttrcAliasKey	        Identifier
664  HiLink muttrcUnAliasKey	Identifier
665  HiLink muttrcAliasEncEmail	Identifier
666  HiLink muttrcAliasParens	Type
667  HiLink muttrcSetNumAssignment	Number
668  HiLink muttrcSetBoolAssignment	Boolean
669  HiLink muttrcSetQuadAssignment	Boolean
670  HiLink muttrcSetStrAssignment	String
671  HiLink muttrcEmail		Special
672  HiLink muttrcVariableInner	Special
673  HiLink muttrcEscapedVariable	String
674  HiLink muttrcHeader		Type
675  HiLink muttrcKeySpecial	SpecialChar
676  HiLink muttrcKey		Type
677  HiLink muttrcKeyName		SpecialChar
678  HiLink muttrcVarBool		Identifier
679  HiLink muttrcVarQuad		Identifier
680  HiLink muttrcVarNum		Identifier
681  HiLink muttrcVarStr		Identifier
682  HiLink muttrcMenu		Identifier
683  HiLink muttrcCommand		Keyword
684  HiLink muttrcMacroDescr	String
685  HiLink muttrcAction		Macro
686  HiLink muttrcBadAction	Error
687  HiLink muttrcBindFunction	Error
688  HiLink muttrcBindMenuList	Error
689  HiLink muttrcFunction		Macro
690  HiLink muttrcGroupKeyword	muttrcCommand
691  HiLink muttrcGroupLine	Error
692  HiLink muttrcSubscribeKeyword	muttrcCommand
693  HiLink muttrcSubscribeLine	Error
694  HiLink muttrcListsKeyword	muttrcCommand
695  HiLink muttrcListsLine	Error
696  HiLink muttrcAlternateKeyword	muttrcCommand
697  HiLink muttrcAlternatesLine	Error
698  HiLink muttrcAttachmentsLine	muttrcCommand
699  HiLink muttrcAttachmentsFlag	Type
700  HiLink muttrcAttachmentsMimeType	String
701  HiLink muttrcColorLine	Error
702  HiLink muttrcColorContext	Error
703  HiLink muttrcColorContextI	Identifier
704  HiLink muttrcColorContextH	Identifier
705  HiLink muttrcColorKeyword	muttrcCommand
706  HiLink muttrcColorKeywordI	muttrcColorKeyword
707  HiLink muttrcColorKeywordH	muttrcColorKeyword
708  HiLink muttrcColorField	Identifier
709  HiLink muttrcColor		Type
710  HiLink muttrcColorFG		Error
711  HiLink muttrcColorFGI		Error
712  HiLink muttrcColorFGH		Error
713  HiLink muttrcColorBG		Error
714  HiLink muttrcColorBGI		Error
715  HiLink muttrcColorBGH		Error
716  HiLink muttrcMonoAttrib	muttrcColor
717  HiLink muttrcMono		muttrcCommand
718  HiLink muttrcSimplePat	Identifier
719  HiLink muttrcSimplePatString	Macro
720  HiLink muttrcSimplePatMetas	Special
721  HiLink muttrcPattern		Error
722  HiLink muttrcUnColorLine	Error
723  HiLink muttrcUnColorKeyword	muttrcCommand
724  HiLink muttrcUnColorIndex	Identifier
725  HiLink muttrcShellString	muttrcEscape
726  HiLink muttrcRXHooks		muttrcCommand
727  HiLink muttrcRXHookNot	Type
728  HiLink muttrcPatHooks		muttrcCommand
729  HiLink muttrcPatHookNot	Type
730  HiLink muttrcFormatConditionals2 Type
731  HiLink muttrcIndexFormatStr	muttrcString
732  HiLink muttrcIndexFormatEscapes muttrcEscape
733  HiLink muttrcIndexFormatConditionals muttrcFormatConditionals2
734  HiLink muttrcAliasFormatStr	muttrcString
735  HiLink muttrcAliasFormatEscapes muttrcEscape
736  HiLink muttrcAttachFormatStr	muttrcString
737  HiLink muttrcAttachFormatEscapes muttrcEscape
738  HiLink muttrcAttachFormatConditionals muttrcFormatConditionals2
739  HiLink muttrcComposeFormatStr	muttrcString
740  HiLink muttrcComposeFormatEscapes muttrcEscape
741  HiLink muttrcFolderFormatStr	muttrcString
742  HiLink muttrcFolderFormatEscapes muttrcEscape
743  HiLink muttrcFolderFormatConditionals muttrcFormatConditionals2
744  HiLink muttrcMixFormatStr	muttrcString
745  HiLink muttrcMixFormatEscapes muttrcEscape
746  HiLink muttrcMixFormatConditionals muttrcFormatConditionals2
747  HiLink muttrcPGPFormatStr	muttrcString
748  HiLink muttrcPGPFormatEscapes muttrcEscape
749  HiLink muttrcPGPFormatConditionals muttrcFormatConditionals2
750  HiLink muttrcPGPCmdFormatStr	muttrcString
751  HiLink muttrcPGPCmdFormatEscapes muttrcEscape
752  HiLink muttrcPGPCmdFormatConditionals muttrcFormatConditionals2
753  HiLink muttrcStatusFormatStr	muttrcString
754  HiLink muttrcStatusFormatEscapes muttrcEscape
755  HiLink muttrcStatusFormatConditionals muttrcFormatConditionals2
756  HiLink muttrcPGPGetKeysFormatStr	muttrcString
757  HiLink muttrcPGPGetKeysFormatEscapes muttrcEscape
758  HiLink muttrcSmimeFormatStr	muttrcString
759  HiLink muttrcSmimeFormatEscapes muttrcEscape
760  HiLink muttrcSmimeFormatConditionals muttrcFormatConditionals2
761  HiLink muttrcTimeEscapes	muttrcEscape
762  HiLink muttrcPGPTimeEscapes	muttrcEscape
763  HiLink muttrcStrftimeEscapes	Type
764  HiLink muttrcStrftimeFormatStr muttrcString
765  HiLink muttrcFormatErrors Error
766
767  HiLink muttrcBindFunctionNL	SpecialChar
768  HiLink muttrcBindKeyNL	SpecialChar
769  HiLink muttrcBindMenuListNL	SpecialChar
770  HiLink muttrcMacroDescrNL	SpecialChar
771  HiLink muttrcMacroBodyNL	SpecialChar
772  HiLink muttrcMacroKeyNL	SpecialChar
773  HiLink muttrcMacroMenuListNL	SpecialChar
774  HiLink muttrcColorMatchCountNL SpecialChar
775  HiLink muttrcColorNL		SpecialChar
776  HiLink muttrcColorRXNL	SpecialChar
777  HiLink muttrcColorBGNL	SpecialChar
778  HiLink muttrcColorFGNL	SpecialChar
779  HiLink muttrcAliasNameNL	SpecialChar
780  HiLink muttrcAliasENNL	SpecialChar
781  HiLink muttrcAliasNL		SpecialChar
782  HiLink muttrcUnAliasNL	SpecialChar
783  HiLink muttrcAliasGroupDefNL	SpecialChar
784  HiLink muttrcAliasEncEmailNL	SpecialChar
785  HiLink muttrcPatternNL	SpecialChar
786  HiLink muttrcUnColorPatNL	SpecialChar
787  HiLink muttrcUnColorAPNL	SpecialChar
788  HiLink muttrcUnColorIndexNL	SpecialChar
789  HiLink muttrcStringNL		SpecialChar
790
791  delcommand HiLink
792endif
793
794let b:current_syntax = "muttrc"
795
796let &cpo = s:cpo_save
797unlet s:cpo_save
798"EOF	vim: ts=8 noet tw=100 sw=8 sts=0 ft=vim
799