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