blob: fb88f6afdfb3a959fbed8cf9b3373f42bc8d6c5c [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Mutt setup files
Bram Moolenaarf9393ef2006-04-24 19:47:27 +00003" Original: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
4" Maintainer: Kyle Wheeler <kyle-muttrc.vim@memoryhole.net>
Bram Moolenaar9964e462007-05-05 17:54:07 +00005" Last Change: 5 Mar 2007
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
Bram Moolenaar9964e462007-05-05 17:54:07 +00007" This file covers mutt version 1.5.14 (and most of CVS HEAD)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +00008" Included are also a few features from 1.4.2.1
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
10" For version 5.x: Clear all syntax items
11" For version 6.x: Quit when a syntax file was already loaded
12if version < 600
13 syntax clear
14elseif exists("b:current_syntax")
15 finish
16endif
17
18" Set the keyword characters
19if version < 600
20 set isk=@,48-57,_,-
21else
22 setlocal isk=@,48-57,_,-
23endif
24
Bram Moolenaar9964e462007-05-05 17:54:07 +000025syn match muttrcComment "^# .*$" contains=@Spell
26syn match muttrcComment "^#[^ ].*$"
27syn match muttrcComment "^#$"
Bram Moolenaar071d4272004-06-13 20:20:40 +000028syn match muttrcComment "[^\\]#.*$"lc=1
29
30" Escape sequences (back-tick and pipe goes here too)
Bram Moolenaar9964e462007-05-05 17:54:07 +000031syn match muttrcEscape +\\[#tnr"'Cc ]+
Bram Moolenaar071d4272004-06-13 20:20:40 +000032syn match muttrcEscape +[`|]+
33
34" The variables takes the following arguments
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000035syn match muttrcString "=\s*[^ #"'`]\+"lc=1 contains=muttrcEscape
Bram Moolenaar9964e462007-05-05 17:54:07 +000036syn region muttrcString start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction
37syn region muttrcString start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000038
39syn region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand,muttrcSet
40
41syn match muttrcRXChars contained /[^\\][][.*?+]\+/hs=s+1
42syn match muttrcRXChars contained /[][|()][.*?+]*/
43syn match muttrcRXChars contained /'^/ms=s+1
44syn match muttrcRXChars contained /$'/me=e-1
45syn match muttrcRXChars contained /\\/
Bram Moolenaar9964e462007-05-05 17:54:07 +000046" Why does muttrcRXString2 work with one \ when muttrcRXString requires two?
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000047syn region muttrcRXString contained start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars
48syn region muttrcRXString contained start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars
Bram Moolenaar9964e462007-05-05 17:54:07 +000049syn region muttrcRXString2 contained start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars
50syn region muttrcRXString2 contained start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000051
52syn region muttrcRXPat contained start=+'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString nextgroup=muttrcRXPat
53syn region muttrcRXPat contained start=+"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString nextgroup=muttrcRXPat
54syn match muttrcRXPat contained /[^-'"#!]\S\+\%(\s\|$\)/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat
55syn match muttrcRXDef contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat
Bram Moolenaar071d4272004-06-13 20:20:40 +000056
57syn match muttrcSpecial +\(['"]\)!\1+
58
59" Numbers and Quadoptions may be surrounded by " or '
60syn match muttrcNumber /=\s*\d\+/lc=1
61syn match muttrcNumber /=\s*"\d\+"/lc=1
62syn match muttrcNumber /=\s*'\d\+'/lc=1
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000063syn match muttrcQuadopt +=\s*\%(ask-\)\=\%(yes\|no\)+lc=1
64syn match muttrcQuadopt +=\s*"\%(ask-\)\=\%(yes\|no\)"+lc=1
65syn match muttrcQuadopt +=\s*'\%(ask-\)\=\%(yes\|no\)'+lc=1
Bram Moolenaar071d4272004-06-13 20:20:40 +000066
67" Now catch some email addresses and headers (purified version from mail.vim)
68syn match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+"
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000069syn match muttrcHeader "\<\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\="
Bram Moolenaar071d4272004-06-13 20:20:40 +000070
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000071syn match muttrcKeySpecial contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+
72syn match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName
73syn region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial,muttrcKeyName
74syn region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial,muttrcKeyName
75syn match muttrcKeyName contained "\<f\%(\d\|10\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000076syn match muttrcKeyName contained "\\[trne]"
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000077syn match muttrcKeyName contained "\c<\%(BackSpace\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000078
Bram Moolenaarf9393ef2006-04-24 19:47:27 +000079syn keyword muttrcVarBool contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc
80syn keyword muttrcVarBool contained askcc attach_split auto_tag autoedit beep beep_new
81syn keyword muttrcVarBool contained bounce_delivered braille_friendly check_new collapse_unread
82syn keyword muttrcVarBool contained confirmappend confirmcreate crypt_autoencrypt crypt_autopgp
83syn keyword muttrcVarBool contained crypt_autosign crypt_autosmime crypt_replyencrypt
84syn keyword muttrcVarBool contained crypt_replysign crypt_replysignencrypted crypt_timestamp
85syn keyword muttrcVarBool contained crypt_use_gpgme delete_untag digest_collapse duplicate_threads
86syn keyword muttrcVarBool contained edit_hdrs edit_headers encode_from envelope_from fast_reply
87syn keyword muttrcVarBool contained fcc_attach fcc_clear followup_to force_name forw_decode
88syn keyword muttrcVarBool contained forw_decrypt forw_quote forward_decode forward_decrypt
89syn keyword muttrcVarBool contained forward_quote hdrs header help hidden_host hide_limited
90syn keyword muttrcVarBool contained hide_missing hide_thread_subject hide_top_limited
91syn keyword muttrcVarBool contained hide_top_missing ignore_list_reply_to imap_check_subscribed
92syn keyword muttrcVarBool contained imap_list_subscribed imap_passive imap_peek imap_servernoise
93syn keyword muttrcVarBool contained implicit_autoview include_onlyfirst keep_flagged
94syn keyword muttrcVarBool contained mailcap_sanitize maildir_header_cache_verify maildir_trash
95syn keyword muttrcVarBool contained mark_old markers menu_move_off menu_scroll meta_key
96syn keyword muttrcVarBool contained metoo mh_purge mime_forward_decode narrow_tree pager_stop
97syn keyword muttrcVarBool contained pgp_auto_decode pgp_auto_traditional pgp_autoencrypt
98syn keyword muttrcVarBool contained pgp_autoinline pgp_autosign pgp_check_exit
99syn keyword muttrcVarBool contained pgp_create_traditional pgp_ignore_subkeys pgp_long_ids
100syn keyword muttrcVarBool contained pgp_replyencrypt pgp_replyinline pgp_replysign
101syn keyword muttrcVarBool contained pgp_replysignencrypted pgp_retainable_sigs pgp_show_unusable
102syn keyword muttrcVarBool contained pgp_strict_enc pgp_use_gpg_agent pipe_decode pipe_split
103syn keyword muttrcVarBool contained pop_auth_try_all pop_last print_decode print_split
104syn keyword muttrcVarBool contained prompt_after read_only reply_self resolve reverse_alias
105syn keyword muttrcVarBool contained reverse_name reverse_realname rfc2047_parameters save_address
106syn keyword muttrcVarBool contained save_empty save_name score sig_dashes sig_on_top
107syn keyword muttrcVarBool contained smart_wrap smime_ask_cert_label smime_decrypt_use_default_key
108syn keyword muttrcVarBool contained smime_is_default sort_re ssl_force_tls ssl_use_sslv2
109syn keyword muttrcVarBool contained ssl_use_sslv3 ssl_use_tlsv1 ssl_usesystemcerts status_on_top
Bram Moolenaar9964e462007-05-05 17:54:07 +0000110syn keyword muttrcVarBool contained strict_mime strict_threads suspend text_flowed thorough_search
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000111syn keyword muttrcVarBool contained thread_received tilde uncollapse_jump use_8bitmime
112syn keyword muttrcVarBool contained use_domain use_envelope_from use_from use_idn use_ipv6
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113syn keyword muttrcVarBool contained user_agent wait_key weed wrap_search write_bcc
114
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000115syn keyword muttrcVarBool contained noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc
116syn keyword muttrcVarBool contained noaskcc noattach_split noauto_tag noautoedit nobeep nobeep_new
117syn keyword muttrcVarBool contained nobounce_delivered nobraille_friendly nocheck_new nocollapse_unread
118syn keyword muttrcVarBool contained noconfirmappend noconfirmcreate nocrypt_autoencrypt nocrypt_autopgp
119syn keyword muttrcVarBool contained nocrypt_autosign nocrypt_autosmime nocrypt_replyencrypt
120syn keyword muttrcVarBool contained nocrypt_replysign nocrypt_replysignencrypted nocrypt_timestamp
121syn keyword muttrcVarBool contained nocrypt_use_gpgme nodelete_untag nodigest_collapse noduplicate_threads
122syn keyword muttrcVarBool contained noedit_hdrs noedit_headers noencode_from noenvelope_from nofast_reply
123syn keyword muttrcVarBool contained nofcc_attach nofcc_clear nofollowup_to noforce_name noforw_decode
124syn keyword muttrcVarBool contained noforw_decrypt noforw_quote noforward_decode noforward_decrypt
125syn keyword muttrcVarBool contained noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited
126syn keyword muttrcVarBool contained nohide_missing nohide_thread_subject nohide_top_limited
127syn keyword muttrcVarBool contained nohide_top_missing noignore_list_reply_to noimap_check_subscribed
Bram Moolenaar071d4272004-06-13 20:20:40 +0000128syn keyword muttrcVarBool contained noimap_list_subscribed noimap_passive noimap_peek noimap_servernoise
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000129syn keyword muttrcVarBool contained noimplicit_autoview noinclude_onlyfirst nokeep_flagged
130syn keyword muttrcVarBool contained nomailcap_sanitize nomaildir_header_cache_verify nomaildir_trash
131syn keyword muttrcVarBool contained nomark_old nomarkers nomenu_move_off nomenu_scroll nometa_key
132syn keyword muttrcVarBool contained nometoo nomh_purge nomime_forward_decode nonarrow_tree nopager_stop
133syn keyword muttrcVarBool contained nopgp_auto_decode nopgp_auto_traditional nopgp_autoencrypt
134syn keyword muttrcVarBool contained nopgp_autoinline nopgp_autosign nopgp_check_exit
135syn keyword muttrcVarBool contained nopgp_create_traditional nopgp_ignore_subkeys nopgp_long_ids
136syn keyword muttrcVarBool contained nopgp_replyencrypt nopgp_replyinline nopgp_replysign
137syn keyword muttrcVarBool contained nopgp_replysignencrypted nopgp_retainable_sigs nopgp_show_unusable
138syn keyword muttrcVarBool contained nopgp_strict_enc nopgp_use_gpg_agent nopipe_decode nopipe_split
139syn keyword muttrcVarBool contained nopop_auth_try_all nopop_last noprint_decode noprint_split
140syn keyword muttrcVarBool contained noprompt_after noread_only noreply_self noresolve noreverse_alias
141syn keyword muttrcVarBool contained noreverse_name noreverse_realname norfc2047_parameters nosave_address
142syn keyword muttrcVarBool contained nosave_empty nosave_name noscore nosig_dashes nosig_on_top
143syn keyword muttrcVarBool contained nosmart_wrap nosmime_ask_cert_label nosmime_decrypt_use_default_key
144syn keyword muttrcVarBool contained nosmime_is_default nosort_re nossl_force_tls nossl_use_sslv2
145syn keyword muttrcVarBool contained nossl_use_sslv3 nossl_use_tlsv1 nossl_usesystemcerts nostatus_on_top
146syn keyword muttrcVarBool contained nostrict_threads nosuspend notext_flowed nothorough_search
147syn keyword muttrcVarBool contained nothread_received notilde nouncollapse_jump nouse_8bitmime
148syn keyword muttrcVarBool contained nouse_domain nouse_envelope_from nouse_from nouse_idn nouse_ipv6
149syn keyword muttrcVarBool contained nouser_agent nowait_key noweed nowrap_search nowrite_bcc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000151syn keyword muttrcVarBool contained invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc
152syn keyword muttrcVarBool contained invaskcc invattach_split invauto_tag invautoedit invbeep invbeep_new
153syn keyword muttrcVarBool contained invbounce_delivered invbraille_friendly invcheck_new invcollapse_unread
154syn keyword muttrcVarBool contained invconfirmappend invconfirmcreate invcrypt_autoencrypt invcrypt_autopgp
155syn keyword muttrcVarBool contained invcrypt_autosign invcrypt_autosmime invcrypt_replyencrypt
156syn keyword muttrcVarBool contained invcrypt_replysign invcrypt_replysignencrypted invcrypt_timestamp
157syn keyword muttrcVarBool contained invcrypt_use_gpgme invdelete_untag invdigest_collapse invduplicate_threads
158syn keyword muttrcVarBool contained invedit_hdrs invedit_headers invencode_from invenvelope_from invfast_reply
159syn keyword muttrcVarBool contained invfcc_attach invfcc_clear invfollowup_to invforce_name invforw_decode
160syn keyword muttrcVarBool contained invforw_decrypt invforw_quote invforward_decode invforward_decrypt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161syn keyword muttrcVarBool contained invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000162syn keyword muttrcVarBool contained invhide_missing invhide_thread_subject invhide_top_limited
163syn keyword muttrcVarBool contained invhide_top_missing invignore_list_reply_to invimap_check_subscribed
164syn keyword muttrcVarBool contained invimap_list_subscribed invimap_passive invimap_peek invimap_servernoise
165syn keyword muttrcVarBool contained invimplicit_autoview invinclude_onlyfirst invkeep_flagged
166syn keyword muttrcVarBool contained invmailcap_sanitize invmaildir_header_cache_verify invmaildir_trash
167syn keyword muttrcVarBool contained invmark_old invmarkers invmenu_move_off invmenu_scroll invmeta_key
168syn keyword muttrcVarBool contained invmetoo invmh_purge invmime_forward_decode invnarrow_tree invpager_stop
169syn keyword muttrcVarBool contained invpgp_auto_decode invpgp_auto_traditional invpgp_autoencrypt
170syn keyword muttrcVarBool contained invpgp_autoinline invpgp_autosign invpgp_check_exit
171syn keyword muttrcVarBool contained invpgp_create_traditional invpgp_ignore_subkeys invpgp_long_ids
172syn keyword muttrcVarBool contained invpgp_replyencrypt invpgp_replyinline invpgp_replysign
173syn keyword muttrcVarBool contained invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable
174syn keyword muttrcVarBool contained invpgp_strict_enc invpgp_use_gpg_agent invpipe_decode invpipe_split
175syn keyword muttrcVarBool contained invpop_auth_try_all invpop_last invprint_decode invprint_split
176syn keyword muttrcVarBool contained invprompt_after invread_only invreply_self invresolve invreverse_alias
177syn keyword muttrcVarBool contained invreverse_name invreverse_realname invrfc2047_parameters invsave_address
178syn keyword muttrcVarBool contained invsave_empty invsave_name invscore invsig_dashes invsig_on_top
179syn keyword muttrcVarBool contained invsmart_wrap invsmime_ask_cert_label invsmime_decrypt_use_default_key
180syn keyword muttrcVarBool contained invsmime_is_default invsort_re invssl_force_tls invssl_use_sslv2
181syn keyword muttrcVarBool contained invssl_use_sslv3 invssl_use_tlsv1 invssl_usesystemcerts invstatus_on_top
182syn keyword muttrcVarBool contained invstrict_threads invsuspend invtext_flowed invthorough_search
183syn keyword muttrcVarBool contained invthread_received invtilde invuncollapse_jump invuse_8bitmime
184syn keyword muttrcVarBool contained invuse_domain invuse_envelope_from invuse_from invuse_idn invuse_ipv6
185syn keyword muttrcVarBool contained invuser_agent invwait_key invweed invwrap_search invwrite_bcc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000186
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000187syn keyword muttrcVarQuad contained abort_nosubject abort_unmodified bounce copy
188syn keyword muttrcVarQuad contained crypt_verify_sig delete forward_edit honor_followup_to
189syn keyword muttrcVarQuad contained include mime_forward mime_forward_rest mime_fwd move
190syn keyword muttrcVarQuad contained pgp_mime_auto pgp_verify_sig pop_delete pop_reconnect
191syn keyword muttrcVarQuad contained postpone print quit recall reply_to ssl_starttls
Bram Moolenaar071d4272004-06-13 20:20:40 +0000192
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000193syn keyword muttrcVarQuad contained noabort_nosubject noabort_unmodified nobounce nocopy
194syn keyword muttrcVarQuad contained nocrypt_verify_sig nodelete noforward_edit nohonor_followup_to
195syn keyword muttrcVarQuad contained noinclude nomime_forward nomime_forward_rest nomime_fwd nomove
196syn keyword muttrcVarQuad contained nopgp_mime_auto nopgp_verify_sig nopop_delete nopop_reconnect
Bram Moolenaar071d4272004-06-13 20:20:40 +0000197syn keyword muttrcVarQuad contained nopostpone noprint noquit norecall noreply_to nossl_starttls
198
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000199syn keyword muttrcVarQuad contained invabort_nosubject invabort_unmodified invbounce invcopy
200syn keyword muttrcVarQuad contained invcrypt_verify_sig invdelete invforward_edit invhonor_followup_to
201syn keyword muttrcVarQuad contained invinclude invmime_forward invmime_forward_rest invmime_fwd invmove
202syn keyword muttrcVarQuad contained invpgp_mime_auto invpgp_verify_sig invpop_delete invpop_reconnect
Bram Moolenaar071d4272004-06-13 20:20:40 +0000203syn keyword muttrcVarQuad contained invpostpone invprint invquit invrecall invreply_to invssl_starttls
204
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000205syn keyword muttrcVarNum contained connect_timeout history imap_keepalive mail_check menu_context net_inc
206syn keyword muttrcVarNum contained pager_context pager_index_lines pgp_timeout pop_checkinterval read_inc
Bram Moolenaar9964e462007-05-05 17:54:07 +0000207syn keyword muttrcVarNum contained save_history score_threshold_delete score_threshold_flag
208syn keyword muttrcVarNum contained score_threshold_read sendmail_wait sleep_time smime_timeout
209syn keyword muttrcVarNum contained ssl_min_dh_prime_bits timeout wrap wrapmargin write_inc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000210
Bram Moolenaar9964e462007-05-05 17:54:07 +0000211syn match muttrcVarStr contained 'my_[a-zA-Z0-9_]\+'
212syn keyword muttrcVarStr contained alias_file alias_format assumed_charset attach_format attach_sep attribution
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000213syn keyword muttrcVarStr contained certificate_file charset compose_format config_charset content_type
214syn keyword muttrcVarStr contained date_format default_hook display_filter dotlock_program dsn_notify
215syn keyword muttrcVarStr contained dsn_return editor entropy_file envelope_from_address escape folder
216syn keyword muttrcVarStr contained folder_format forw_format forward_format from gecos_mask hdr_format
Bram Moolenaar9964e462007-05-05 17:54:07 +0000217syn keyword muttrcVarStr contained header_cache header_cache_pagesize history_file hostname imap_authenticators
218syn keyword muttrcVarStr contained imap_delim_chars imap_headers imap_home_namespace imap_idle imap_login imap_pass
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000219syn keyword muttrcVarStr contained imap_user indent_str indent_string index_format ispell locale mailcap_path
Bram Moolenaar9964e462007-05-05 17:54:07 +0000220syn keyword muttrcVarStr contained mask mbox mbox_type message_format message_cachedir mh_seq_flagged mh_seq_replied
Bram Moolenaar071d4272004-06-13 20:20:40 +0000221syn keyword muttrcVarStr contained mh_seq_unseen mix_entry_format mixmaster msg_format pager pager_format
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000222syn keyword muttrcVarStr contained pgp_clearsign_command pgp_decode_command pgp_decrypt_command
223syn keyword muttrcVarStr contained pgp_encrypt_only_command pgp_encrypt_sign_command pgp_entry_format
224syn keyword muttrcVarStr contained pgp_export_command pgp_getkeys_command pgp_good_sign pgp_import_command
Bram Moolenaar9964e462007-05-05 17:54:07 +0000225syn keyword muttrcVarStr contained pgp_list_pubring_command pgp_list_secring_command pgp_mime_signature_filename
226syn keyword muttrcVarStr contained pgp_mime_signature_description pgp_sign_as
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000227syn keyword muttrcVarStr contained pgp_sign_command pgp_sort_keys pgp_verify_command pgp_verify_key_command
228syn keyword muttrcVarStr contained pipe_sep pop_authenticators pop_host pop_pass pop_user post_indent_str
229syn keyword muttrcVarStr contained post_indent_string postponed preconnect print_cmd print_command
230syn keyword muttrcVarStr contained query_command quote_regexp realname record reply_regexp send_charset
231syn keyword muttrcVarStr contained sendmail shell signature simple_search smileys smime_ca_location
232syn keyword muttrcVarStr contained smime_certificates smime_decrypt_command smime_default_key
233syn keyword muttrcVarStr contained smime_encrypt_command smime_encrypt_with smime_get_cert_command
234syn keyword muttrcVarStr contained smime_get_cert_email_command smime_get_signer_cert_command
235syn keyword muttrcVarStr contained smime_import_cert_command smime_keys smime_pk7out_command smime_sign_as
236syn keyword muttrcVarStr contained smime_sign_command smime_sign_opaque_command smime_verify_command
Bram Moolenaar9964e462007-05-05 17:54:07 +0000237syn keyword muttrcVarStr contained smime_verify_opaque_command smtp_url smtp_authenticators sort sort_alias sort_aux
238syn keyword muttrcVarStr contained sort_browser spam_separator spoolfile ssl_ca_certificates_file ssl_client_cert
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000239syn keyword muttrcVarStr contained status_chars status_format tmpdir to_chars tunnel visual
240
241" Present in 1.4.2.1 (pgp_create_traditional was a bool then)
242syn keyword muttrcVarBool contained imap_force_ssl imap_force_ssl noinvimap_force_ssl
243"syn keyword muttrcVarQuad contained pgp_create_traditional nopgp_create_traditional invpgp_create_traditional
244syn keyword muttrcVarStr contained alternates
Bram Moolenaar071d4272004-06-13 20:20:40 +0000245
246syn keyword muttrcMenu contained alias attach browser compose editor index pager postpone pgp mix query generic
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000247syn match muttrcMenuList "\S\+" contained contains=muttrcMenu
248syn match muttrcMenuCommas /,/ contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000249
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000250syn keyword muttrcCommand auto_view alternative_order charset-hook exec unalternative_order
251syn keyword muttrcCommand hdr_order iconv-hook ignore mailboxes my_hdr unmailboxes
252syn keyword muttrcCommand pgp-hook push score source unauto_view unhdr_order
Bram Moolenaar9964e462007-05-05 17:54:07 +0000253syn keyword muttrcCommand unignore unmono unmy_hdr unscore
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000254syn keyword muttrcCommand mime_lookup unmime_lookup spam ungroup
255syn keyword muttrcCommand nospam unalternative_order
256
Bram Moolenaar9964e462007-05-05 17:54:07 +0000257syn keyword muttrcHooks contained 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
258syn keyword muttrcUnhook contained unhook
259syn region muttrcUnhookLine keepend start=+^\s*unhook\s+ skip=+\\$+ end=+$+ contains=muttrcUnhook,muttrcHooks,muttrcUnHighlightSpace,muttrcComment
260
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000261syn match muttrcAttachmentsMimeType contained "[*a-z0-9_-]\+/[*a-z0-9._-]\+\s*" skipwhite nextgroup=muttrcAttachmentsMimeType
262syn match muttrcAttachmentsFlag contained "[+-]\%([AI]\|inline\|attachment\)\s\+" skipwhite nextgroup=muttrcAttachmentsMimeType
263syn match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite nextgroup=muttrcAttachmentsFlag
264
265syn match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)"
266
267syn keyword muttrcListsKeyword contained lists unlists
268syn region muttrcListsLine keepend start=+^\s*\%(un\)\?lists\s+ skip=+\\$+ end=+$+ contains=muttrcListsKeyword,muttrcRXPat,muttrcGroupDef,muttrcUnHighlightSpace,muttrcComment
269
270syn keyword muttrcSubscribeKeyword contained subscribe unsubscribe
271syn region muttrcSubscribeLine keepend start=+^\s*\%(un\)\?subscribe\s+ skip=+\\$+ end=+$+ contains=muttrcSubscribeKeyword,muttrcRXPat,muttrcGroupDef,muttrcUnHighlightSpace,muttrcComment
272
273syn keyword muttrcAlternateKeyword contained alternates unalternates
274syn region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment
275
276syn match muttrcVariable "\$[a-zA-Z_-]\+"
277
278syn match muttrcBadAction contained "[^<>]\+" contains=muttrcEmail
279syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|recall\|resent\|save\|send\|tag\|undelete\)-message\>"
280syn match muttrcFunction contained "\<\%(delete\|next\|previous\|read\|tag\|undelete\)-thread\>"
281syn match muttrcFunction contained "\<\%(backward\|capitalize\|downcase\|forward\|kill\|upcase\)-word\>"
282syn match muttrcFunction contained "\<\%(delete\|filter\|first\|last\|next\|pipe\|previous\|print\|save\|select\|tag\|undelete\)-entry\>"
283syn match muttrcFunction contained "\<attach-\%(file\|key\)\>"
284syn match muttrcFunction contained "\<change-\%(dir\|folder\|folder-readonly\)\>"
285syn match muttrcFunction contained "\<check-\%(new\|traditional-pgp\)\>"
286syn match muttrcFunction contained "\<current-\%(bottom\|middle\|top\)\>"
287syn match muttrcFunction contained "\<decode-\%(copy\|save\)\>"
288syn match muttrcFunction contained "\<delete-\%(char\|pattern\|subthread\)\>"
289syn match muttrcFunction contained "\<display-\%(address\|toggle-weed\)\>"
290syn match muttrcFunction contained "\<edit\%(-\%(bcc\|cc\|description\|encoding\|fcc\|file\|from\|headers\|mime\|reply-to\|subject\|to\|type\)\)\?\>"
291syn match muttrcFunction contained "\<enter-\%(command\|mask\)\>"
292syn match muttrcFunction contained "\<half-\%(up\|down\)\>"
293syn match muttrcFunction contained "\<history-\%(up\|down\)\>"
294syn match muttrcFunction contained "\<kill-\%(eol\|eow\|line\)\>"
295syn match muttrcFunction contained "\<next-\%(line\|new\|page\|subthread\|undeleted\|unread\)\>"
296syn match muttrcFunction contained "\<previous-\%(line\|new\|page\|subthread\|undeleted\|unread\)\>"
297syn match muttrcFunction contained "\<search\%(-\%(next\|opposite\|reverse\|toggle\)\)\?\>"
298syn match muttrcFunction contained "\<show-\%(limit\|version\)\>"
299syn match muttrcFunction contained "\<sort-\%(mailbox\|reverse\)\>"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000300syn match muttrcFunction contained "\<tag-\%(pattern\|prefix\%(-cond\)\?\)\>"
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000301syn match muttrcFunction contained "\<toggle-\%(mailboxes\|new\|quoted\|subscribed\|unlink\|write\)\>"
302syn match muttrcFunction contained "\<undelete-\%(pattern\|subthread\)\>"
303syn match muttrcFunction contained "\<collapse-\%(parts\|thread\|all\)\>"
304syn match muttrcFunction contained "\<view-\%(attach\|attachments\|file\|mailcap\|name\|text\)\>"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000305syn 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\)\>"
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000306syn match muttrcAction contained "<[^>]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName
Bram Moolenaar071d4272004-06-13 20:20:40 +0000307
308syn keyword muttrcSet set skipwhite nextgroup=muttrcVar.*
309syn keyword muttrcUnset unset skipwhite nextgroup=muttrcVar.*
310syn keyword muttrcReset reset skipwhite nextgroup=muttrcVar.*
311syn keyword muttrcToggle toggle skipwhite nextgroup=muttrcVar.*
312
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000313" First, functions that take regular expressions:
314syn match muttrcRXHookNot contained /!\s*/ skipwhite nextgroup=muttrcRXString
315syn match muttrcRXHooks /^\s*\%(account\|folder\)-hook\s\+/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXString
Bram Moolenaar071d4272004-06-13 20:20:40 +0000316
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000317" Now, functions that take patterns
318syn match muttrcPatHookNot contained /!\s*/ skipwhite nextgroup=muttrcPattern
319syn match muttrcPatHooks /^\s*\%(message\|mbox\|save\|fcc\%(-save\)\?\|send2\?\|reply\|crypt\)-hook\s\+/ nextgroup=muttrcPatHookNot,muttrcPattern
Bram Moolenaar071d4272004-06-13 20:20:40 +0000320
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000321syn match muttrcBindFunction contained /\S\+\%(\s\|$\)/ skipwhite contains=muttrcFunction
322syn match muttrcBindFunctionNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL
323syn match muttrcBindKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL
324syn match muttrcBindKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindKey,muttrcBindKeyNL
325syn match muttrcBindMenuList contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcBindKey,muttrcBindKeyNL
326syn match muttrcBindMenuListNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
327syn match muttrcBind /^\s*bind\s\?/ skipwhite nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
328
Bram Moolenaar9964e462007-05-05 17:54:07 +0000329syn region muttrcMacroDescr contained keepend skipwhite start=+\s*\S+ms=e skip=+\\ + end=+ \|$+me=s
330syn region muttrcMacroDescr contained keepend skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s
331syn region muttrcMacroDescr contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s
332syn match muttrcMacroDescrNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
333syn region muttrcMacroBody contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
334syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
335syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
336syn match muttrcMacroBodyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroBody,muttrcMacroBodyNL
337syn match muttrcMacroKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcMacroBody,muttrcMacroBodyNL
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000338syn match muttrcMacroKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroKey,muttrcMacroKeyNL
339syn match muttrcMacroMenuList contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcMacroKey,muttrcMacroKeyNL
340syn match muttrcMacroMenuListNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL
341syn match muttrcMacro /^\s*macro\s\?/ skipwhite nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL
342
343syn match muttrcAddrContent contained "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+\s*" skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
344syn region muttrcAddrContent contained start=+'+ end=+'\s*+ skip=+\\'+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
345syn region muttrcAddrContent contained start=+"+ end=+"\s*+ skip=+\\"+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
346syn match muttrcAddrDef contained "-addr\s\+" skipwhite nextgroup=muttrcAddrContent
347
348syn match muttrcGroupFlag contained "-group"
349syn region muttrcGroupDef contained start="-group\s\+" skip="\\$" end="\s" skipwhite keepend contains=muttrcGroupFlag,muttrcUnHighlightSpace
350
351syn keyword muttrcGroupKeyword contained group ungroup
352syn region muttrcGroupLine keepend start=+^\s*\%(un\)\?group\s+ skip=+\\$+ end=+$+ contains=muttrcGroupKeyword,muttrcGroupDef,muttrcAddrDef,muttrcRXDef,muttrcUnHighlightSpace,muttrcComment
353
Bram Moolenaar9964e462007-05-05 17:54:07 +0000354syn match muttrcAliasGroupName contained /\w\+/ skipwhite nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000355syn match muttrcAliasGroupDefNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL
356syn match muttrcAliasGroupDef contained /\s*-group/ skipwhite nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL contains=muttrcGroupFlag
Bram Moolenaar9964e462007-05-05 17:54:07 +0000357syn match muttrcAliasComma contained /,/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
358syn match muttrcAliasEmail contained /\S\+@\S\+/ contains=muttrcEmail nextgroup=muttrcAliasName,muttrcAliasNameNL skipwhite
359syn match muttrcAliasEncEmail contained /<[^>]\+>/ contains=muttrcEmail nextgroup=muttrcAliasComma
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000360syn match muttrcAliasEncEmailNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL
361syn match muttrcAliasNameNoParens contained /[^<(@]\+\s\+/ nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL
362syn region muttrcAliasName contained matchgroup=Type start=/(/ end=/)/ skipwhite
363syn match muttrcAliasNameNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasName,muttrcAliasNameNL
Bram Moolenaar9964e462007-05-05 17:54:07 +0000364syn match muttrcAliasENNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
365syn match muttrcAliasKey contained /\s*[^- \t]\S\+/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
366syn match muttrcAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
367syn match muttrcAlias /^\s*alias\s/ skipwhite nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000368
Bram Moolenaar9964e462007-05-05 17:54:07 +0000369syn match muttrcUnAliasKey contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
370syn match muttrcUnAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
371syn match muttrcUnAlias /^\s*unalias\s\?/ nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000372
373syn match muttrcSimplePat contained "!\?\^\?[~][ADEFgGklNOpPQRSTuUvV=$]"
374syn match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s\+\%([<>-][0-9]\+\|[0-9]\+[-][0-9]*\)"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000375syn 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]\)\)"
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000376syn match muttrcSimplePat contained "!\?\^\?[~][bBcCefhHiLstxy]\s\+" nextgroup=muttrcSimplePatRXContainer
Bram Moolenaar9964e462007-05-05 17:54:07 +0000377syn match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s\+" nextgroup=muttrcSimplePatString
378syn match muttrcSimplePat contained "!\?\^\?[=][bh]\s\+" nextgroup=muttrcSimplePatString
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000379"syn match muttrcSimplePat contained /"[^~=%][^"]*/ contains=muttrcRXPat
380"syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXPat
Bram Moolenaar9964e462007-05-05 17:54:07 +0000381syn match muttrcSimplePatString contained /[a-zA-Z0-9]\+/
382syn region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+
383syn region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000384syn region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXPat
385syn region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXPat
386syn match muttrcSimplePatRXContainer contained /\S\+/ contains=muttrcRXPat
387syn match muttrcSimplePatMetas contained /[(|)]/
388
389syn region muttrcPattern contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPatternInner
390syn region muttrcPattern contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPatternInner
391syn match muttrcPattern contained "[~][A-Za-z]" contains=muttrcSimplePat
392syn region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
393syn region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
Bram Moolenaar071d4272004-06-13 20:20:40 +0000394
395" Colour definitions takes object, foreground and background arguments (regexps excluded).
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000396syn match muttrcColorMatchCount contained "[0-9]\+"
397syn match muttrcColorMatchCountNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
Bram Moolenaar9964e462007-05-05 17:54:07 +0000398syn region muttrcColorRXPat contained start=+\s*'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
399syn region muttrcColorRXPat contained start=+\s*"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000400syn keyword muttrcColorField contained attachment body bold error hdrdefault header index indicator markers message normal quoted search signature status tilde tree underline
Bram Moolenaar071d4272004-06-13 20:20:40 +0000401syn match muttrcColorField contained "\<quoted\d\=\>"
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000402syn keyword muttrcColor contained black blue cyan default green magenta red white yellow
403syn keyword muttrcColor contained brightblack brightblue brightcyan brightdefault brightgreen brightmagenta brightred brightwhite brightyellow
404syn match muttrcColor contained "\<\%(bright\)\=color\d\{1,2}\>"
405" Now for the structure of the color line
Bram Moolenaar9964e462007-05-05 17:54:07 +0000406syn match muttrcColorRXNL contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL
407syn match muttrcColorBG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL
408syn match muttrcColorBGNL contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL
409syn match muttrcColorFG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL
410syn match muttrcColorFGNL contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL
411syn match muttrcColorContext contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorFG,muttrcColorFGNL
412syn match muttrcColorNL contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL
413syn match muttrcColorKeyword contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000414syn region muttrcColorLine keepend start=/^\s*color\s\+\%(index\)\@!/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace
415" Now for the structure of the color index line
Bram Moolenaar9964e462007-05-05 17:54:07 +0000416syn match muttrcPatternNL contained skipnl "\s*\\$" nextgroup=muttrcPattern,muttrcPatternNL
417syn match muttrcColorBGI contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcPattern,muttrcPatternNL
418syn match muttrcColorBGNLI contained skipnl "\s*\\$" nextgroup=muttrcColorBGI,muttrcColorBGNLI
419syn match muttrcColorFGI contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGI,muttrcColorBGNLI
420syn match muttrcColorFGNLI contained skipnl "\s*\\$" nextgroup=muttrcColorFGI,muttrcColorFGNLI
421syn match muttrcColorContextI contained /\s*index/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGI,muttrcColorFGNLI
422syn match muttrcColorNLI contained skipnl "\s*\\$" nextgroup=muttrcColorContextI,muttrcColorNLI
423syn match muttrcColorKeywordI contained /^\s*color\s\+/ nextgroup=muttrcColorContextI,muttrcColorNLI
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000424syn region muttrcColorLine keepend start=/^\s*color\s\+index/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordI,muttrcComment,muttrcUnHighlightSpace
425" And now color's brother:
426syn region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
427syn region muttrcUnColorPatterns contained skipwhite start=+\s*"+ end=+"+ skip=+\\"+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
428syn match muttrcUnColorPatterns contained skipwhite /\s*[^'"\s]\S\*/ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
429syn match muttrcUnColorPatNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
430syn match muttrcUnColorAll contained skipwhite /[*]/
431syn match muttrcUnColorAPNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL
432syn match muttrcUnColorIndex contained skipwhite /\s*index\s\+/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL
433syn match muttrcUnColorIndexNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL
434syn match muttrcUnColorKeyword contained skipwhite /^\s*uncolor\s\+/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL
435syn region muttrcUnColorLine keepend start=+^\s*uncolor\s+ skip=+\\$+ end=+$+ contains=muttrcUnColorKeyword,muttrcComment,muttrcUnHighlightSpace
Bram Moolenaar071d4272004-06-13 20:20:40 +0000436
437" Mono are almost like color (ojects inherited from color)
438syn keyword muttrcMonoAttrib contained bold none normal reverse standout underline
439syn keyword muttrcMono contained mono skipwhite nextgroup=muttrcColorField
440syn match muttrcMonoLine "^\s*mono\s\+\S\+" skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono
441
442" Define the default highlighting.
443" For version 5.7 and earlier: only when not done already
444" For version 5.8 and later: only when an item doesn't have highlighting yet
445if version >= 508 || !exists("did_muttrc_syntax_inits")
446 if version < 508
447 let did_muttrc_syntax_inits = 1
448 command -nargs=+ HiLink hi link <args>
449 else
450 command -nargs=+ HiLink hi def link <args>
451 endif
452
453 HiLink muttrcComment Comment
454 HiLink muttrcEscape SpecialChar
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000455 HiLink muttrcRXChars SpecialChar
Bram Moolenaar071d4272004-06-13 20:20:40 +0000456 HiLink muttrcString String
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000457 HiLink muttrcRXString String
Bram Moolenaar9964e462007-05-05 17:54:07 +0000458 HiLink muttrcRXString2 String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000459 HiLink muttrcSpecial Special
Bram Moolenaar9964e462007-05-05 17:54:07 +0000460 HiLink muttrcHooks Type
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000461 HiLink muttrcGroupFlag Type
462 HiLink muttrcGroupDef Macro
463 HiLink muttrcAddrDef muttrcGroupFlag
464 HiLink muttrcRXDef muttrcGroupFlag
465 HiLink muttrcRXPat String
466 HiLink muttrcAliasGroupName Macro
Bram Moolenaar9964e462007-05-05 17:54:07 +0000467 HiLink muttrcAliasKey Identifier
468 HiLink muttrcUnAliasKey Identifier
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000469 HiLink muttrcAliasEncEmail Identifier
470 HiLink muttrcAliasParens Type
Bram Moolenaar071d4272004-06-13 20:20:40 +0000471 HiLink muttrcNumber Number
472 HiLink muttrcQuadopt Boolean
473 HiLink muttrcEmail Special
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000474 HiLink muttrcVariable Special
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475 HiLink muttrcHeader Type
476 HiLink muttrcKeySpecial SpecialChar
477 HiLink muttrcKey Type
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000478 HiLink muttrcKeyName SpecialChar
Bram Moolenaar071d4272004-06-13 20:20:40 +0000479 HiLink muttrcVarBool Identifier
480 HiLink muttrcVarQuad Identifier
481 HiLink muttrcVarNum Identifier
482 HiLink muttrcVarStr Identifier
483 HiLink muttrcMenu Identifier
484 HiLink muttrcCommand Keyword
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000485 HiLink muttrcSet Keyword
Bram Moolenaar071d4272004-06-13 20:20:40 +0000486 HiLink muttrcUnset muttrcCommand
487 HiLink muttrcReset muttrcCommand
488 HiLink muttrcToggle muttrcCommand
489 HiLink muttrcBind muttrcCommand
490 HiLink muttrcMacro muttrcCommand
Bram Moolenaar9964e462007-05-05 17:54:07 +0000491 HiLink muttrcMacroDescr String
Bram Moolenaar071d4272004-06-13 20:20:40 +0000492 HiLink muttrcAlias muttrcCommand
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000493 HiLink muttrcUnAlias muttrcCommand
Bram Moolenaar9964e462007-05-05 17:54:07 +0000494 HiLink muttrcUnhook muttrcCommand
495 HiLink muttrcUnhookLine Error
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000496 HiLink muttrcAction Macro
497 HiLink muttrcBadAction Error
498 HiLink muttrcBindFunction Error
499 HiLink muttrcBindMenuList Error
500 HiLink muttrcFunction Macro
501 HiLink muttrcGroupKeyword muttrcCommand
502 HiLink muttrcGroupLine Error
503 HiLink muttrcSubscribeKeyword muttrcCommand
504 HiLink muttrcSubscribeLine Error
505 HiLink muttrcListsKeyword muttrcCommand
506 HiLink muttrcListsLine Error
507 HiLink muttrcAlternateKeyword muttrcCommand
508 HiLink muttrcAlternatesLine Error
509 HiLink muttrcAttachmentsLine muttrcCommand
510 HiLink muttrcAttachmentsFlag Type
511 HiLink muttrcAttachmentsMimeType String
512 HiLink muttrcColorLine Error
513 HiLink muttrcColorContext Error
514 HiLink muttrcColorContextI Identifier
515 HiLink muttrcColorKeyword muttrcCommand
516 HiLink muttrcColorKeywordI muttrcColorKeyword
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517 HiLink muttrcColorField Identifier
Bram Moolenaar9964e462007-05-05 17:54:07 +0000518 HiLink muttrcColor Type
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000519 HiLink muttrcColorFG Error
520 HiLink muttrcColorFGI Error
521 HiLink muttrcColorBG Error
522 HiLink muttrcColorBGI Error
523 HiLink muttrcMonoAttrib muttrcColor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000524 HiLink muttrcMono muttrcCommand
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000525 HiLink muttrcSimplePat Identifier
Bram Moolenaar9964e462007-05-05 17:54:07 +0000526 HiLink muttrcSimplePatString Macro
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000527 HiLink muttrcSimplePatMetas Special
528 HiLink muttrcPattern Type
529 HiLink muttrcPatternInner Error
530 HiLink muttrcUnColorLine Error
531 HiLink muttrcUnColorKeyword muttrcCommand
532 HiLink muttrcUnColorIndex Identifier
533 HiLink muttrcShellString muttrcEscape
534 HiLink muttrcRXHooks muttrcCommand
535 HiLink muttrcRXHookNot Type
536 HiLink muttrcPatHooks muttrcCommand
537 HiLink muttrcPatHookNot Type
Bram Moolenaar071d4272004-06-13 20:20:40 +0000538
Bram Moolenaar9964e462007-05-05 17:54:07 +0000539 HiLink muttrcBindFunctionNL SpecialChar
540 HiLink muttrcBindKeyNL SpecialChar
541 HiLink muttrcBindMenuListNL SpecialChar
542 HiLink muttrcMacroDescrNL SpecialChar
543 HiLink muttrcMacroBodyNL SpecialChar
544 HiLink muttrcMacroKeyNL SpecialChar
545 HiLink muttrcMacroMenuListNL SpecialChar
546 HiLink muttrcColorMatchCountNL SpecialChar
547 HiLink muttrcColorNL SpecialChar
548 HiLink muttrcColorRXNL SpecialChar
549 HiLink muttrcColorBGNL SpecialChar
550 HiLink muttrcColorFGNL SpecialChar
551 HiLink muttrcAliasNameNL SpecialChar
552 HiLink muttrcAliasENNL SpecialChar
553 HiLink muttrcAliasNL SpecialChar
554 HiLink muttrcUnAliasNL SpecialChar
555 HiLink muttrcAliasGroupDefNL SpecialChar
556 HiLink muttrcAliasEncEmailNL SpecialChar
557 HiLink muttrcPatternNL SpecialChar
558 HiLink muttrcUnColorPatNL SpecialChar
559 HiLink muttrcUnColorAPNL SpecialChar
560 HiLink muttrcUnColorIndexNL SpecialChar
561
Bram Moolenaar071d4272004-06-13 20:20:40 +0000562 delcommand HiLink
563endif
564
565let b:current_syntax = "muttrc"
566
567"EOF vim: ts=8 noet tw=100 sw=8 sts=0