useless
[apps/madmutt.git] / contrib / muttngrc.vim
1 " Vim syntax file
2 "
3 " Modified by Lars Noschinski <lars.noschinski@users.berlios.de> for mutt-ng
4 " Last Change:  06 March 2004
5
6 " Language:     Mutt setup files
7 " Maintainer:   Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
8 " Contributor:  Gary Johnson <garyjohn@spk.agilent.com>
9
10 " This file covers mutt version 1.4.2.1i and mutt-ng rev. 149
11
12 " For version 5.x: Clear all syntax items
13 " For version 6.x: Quit when a syntax file was already loaded
14 if version < 600
15   syntax clear
16 elseif exists("b:current_syntax")
17   finish
18 endif
19
20 " Set the keyword characters
21 if version < 600
22   set isk=@,48-57,_,-
23 else
24   setlocal isk=@,48-57,_,-
25 endif
26
27 syn match muttrcComment         "^#.*$"
28 syn match muttrcComment         "[^\\]#.*$"lc=1
29
30 " Escape sequences (back-tick and pipe goes here too)
31 syn match muttrcEscape          +\\[#tnr"'Cc]+
32 syn match muttrcEscape          +[`|]+
33
34 " The variables takes the following arguments
35 syn match  muttrcString         "=\s*[^ #"']\+"lc=1 contains=muttrcEscape
36 syn region muttrcString         start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcMacro,muttrcCommand
37 syn region muttrcString         start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcMacro,muttrcCommand
38
39 syn match muttrcSpecial         +\(['"]\)!\1+
40
41 " Numbers and Quadoptions may be surrounded by " or '
42 syn match muttrcNumber          /=\s*\d\+/lc=1
43 syn match muttrcNumber          /=\s*"\d\+"/lc=1
44 syn match muttrcNumber          /=\s*'\d\+'/lc=1
45 syn match muttrcQuadopt         +=\s*\(ask-\)\=\(yes\|no\)+lc=1
46 syn match muttrcQuadopt         +=\s*"\(ask-\)\=\(yes\|no\)"+lc=1
47 syn match muttrcQuadopt         +=\s*'\(ask-\)\=\(yes\|no\)'+lc=1
48
49 " Now catch some email addresses and headers (purified version from mail.vim)
50 syn match muttrcEmail           "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+"
51 syn match muttrcHeader          "\<\(From\|To\|Cc\|Bcc\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\="
52
53 syn match   muttrcKeySpecial    contained +\(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+
54 syn match   muttrcKey           contained "\S\+"                        contains=muttrcKeySpecial
55 syn region  muttrcKey           contained start=+"+ skip=+\\\\\|\\"+ end=+"+    contains=muttrcKeySpecial
56 syn region  muttrcKey           contained start=+'+ skip=+\\\\\|\\'+ end=+'+    contains=muttrcKeySpecial
57 syn match   muttrcKeyName       contained "\<f\(\d\|10\)\>"
58 syn match   muttrcKeyName       contained "\\[trne]"
59 syn match   muttrcKeyName       contained "<\(BackSpace\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>"
60
61 syn keyword muttrcVarBool       contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split
62 syn keyword muttrcVarBool       contained auto_tag autoedit beep beep_new bounce_delivered check_new collapse_unread
63 syn keyword muttrcVarBool       contained confirmappend confirmcreate delete_untag digest_collapse duplicate_threads
64 syn keyword muttrcVarBool       contained edit_headers edit_headers encode_from envelope_from fast_reply fcc_attach
65 syn keyword muttrcVarBool       contained fcc_clear followup_to force_name forward_decode forward_decrypt forward_quote
66 syn keyword muttrcVarBool       contained forward_decode forward_decrypt forward_quote hdrs header help hidden_host
67 syn keyword muttrcVarBool       contained hide_limited hide_missing hide_top_limited hide_top_missing ignore_list_reply_to
68 syn keyword muttrcVarBool       contained imap_force_ssl imap_list_subscribed imap_passive imap_peek imap_servernoise
69 syn keyword muttrcVarBool       contained implicit_autoview keep_flagged mailcap_sanitize maildir_trash mark_old markers
70 syn keyword muttrcVarBool       contained menu_scroll meta_key metoo mh_purge mime_forward_decode pager_stop crypt_autoencrypt
71 syn keyword muttrcVarBool       contained crypt_autosign pgp_ignore_subkeys pgp_long_ids crypt_replyencrypt crypt_replysign
72 syn keyword muttrcVarBool       contained crypt_replysignencrypted pgp_retainable_sigs pgp_show_unusable pgp_strict_enc
73 syn keyword muttrcVarBool       contained pipe_decode pipe_split pop_auth_try_all pop_last print_decode print_split
74 syn keyword muttrcVarBool       contained prompt_after read_only reply_self resolve reverse_alias reverse_name
75 syn keyword muttrcVarBool       contained reverse_realname rfc2047_parameters save_address save_empty save_name score
76 syn keyword muttrcVarBool       contained sig_dashes sig_on_top smart_wrap sort_re ssl_use_sslv2 ssl_use_sslv3 ssl_use_tlsv1
77 syn keyword muttrcVarBool       contained ssl_usesystemcerts status_on_top strict_threads suspend text_flowed thorough_search
78 syn keyword muttrcVarBool       contained thread_received tilde uncollapse_jump use_8bitmime use_domain use_from use_ipv6
79 syn keyword muttrcVarBool       contained agent_string wait_key weed wrap_search write_bcc
80
81 syn keyword muttrcVarBool       contained noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc noaskcc
82 syn keyword muttrcVarBool       contained noattach_split noauto_tag noautoedit nobeep nobeep_new nobounce_delivered
83 syn keyword muttrcVarBool       contained nocheck_new nocollapse_unread noconfirmappend noconfirmcreate nodelete_untag
84 syn keyword muttrcVarBool       contained nodigest_collapse noduplicate_threads noedit_hdrs noedit_headers noencode_from
85 syn keyword muttrcVarBool       contained noenvelope_from nofast_reply nofcc_attach nofcc_clear nofollowup_to noforce_name
86 syn keyword muttrcVarBool       contained noforw_decode noforw_decrypt noforw_quote noforward_decode noforward_decrypt
87 syn keyword muttrcVarBool       contained noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nohide_missing
88 syn keyword muttrcVarBool       contained nohide_top_limited nohide_top_missing noignore_list_reply_to noimap_force_ssl
89 syn keyword muttrcVarBool       contained noimap_list_subscribed noimap_passive noimap_peek noimap_servernoise
90 syn keyword muttrcVarBool       contained noimplicit_autoview nokeep_flagged nomailcap_sanitize nomaildir_trash nomark_old
91 syn keyword muttrcVarBool       contained nomarkers nomenu_scroll nometa_key nometoo nomh_purge nomime_forward_decode
92 syn keyword muttrcVarBool       contained nopager_stop nopgp_autoencrypt nopgp_autosign nopgp_ignore_subkeys nopgp_long_ids
93 syn keyword muttrcVarBool       contained nopgp_replyencrypt nopgp_replysign nopgp_replysignencrypted nopgp_retainable_sigs
94 syn keyword muttrcVarBool       contained nopgp_show_unusable nopgp_strict_enc nopipe_decode nopipe_split nopop_auth_try_all
95 syn keyword muttrcVarBool       contained nopop_last noprint_decode noprint_split noprompt_after noread_only noreply_self
96 syn keyword muttrcVarBool       contained noresolve noreverse_alias noreverse_name noreverse_realname norfc2047_parameters
97 syn keyword muttrcVarBool       contained nosave_address nosave_empty nosave_name noscore nosig_dashes nosig_on_top
98 syn keyword muttrcVarBool       contained nosmart_wrap nosort_re nossl_use_sslv2 nossl_use_sslv3 nossl_use_tlsv1
99 syn keyword muttrcVarBool       contained nossl_usesystemcerts nostatus_on_top nostrict_threads nosuspend notext_flowed
100 syn keyword muttrcVarBool       contained nothorough_search nothread_received notilde nouncollapse_jump nouse_8bitmime
101 syn keyword muttrcVarBool       contained nouse_domain nouse_from nouse_ipv6 nouser_agent nowait_key noweed nowrap_search
102 syn keyword muttrcVarBool       contained nowrite_bcc
103
104 syn keyword muttrcVarBool       contained invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc invaskcc
105 syn keyword muttrcVarBool       contained invattach_split invauto_tag invautoedit invbeep invbeep_new invbounce_delivered
106 syn keyword muttrcVarBool       contained invcheck_new invcollapse_unread invconfirmappend invconfirmcreate invdelete_untag
107 syn keyword muttrcVarBool       contained invdigest_collapse invduplicate_threads invedit_hdrs invedit_headers invencode_from
108 syn keyword muttrcVarBool       contained invenvelope_from invfast_reply invfcc_attach invfcc_clear invfollowup_to invforce_name
109 syn keyword muttrcVarBool       contained invforw_decode invforw_decrypt invforw_quote invforward_decode invforward_decrypt
110 syn keyword muttrcVarBool       contained invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited
111 syn keyword muttrcVarBool       contained invhide_missing invhide_top_limited invhide_top_missing invignore_list_reply_to
112 syn keyword muttrcVarBool       contained invimap_force_ssl invimap_list_subscribed invimap_passive invimap_peek
113 syn keyword muttrcVarBool       contained invimap_servernoise invimplicit_autoview invkeep_flagged invmailcap_sanitize
114 syn keyword muttrcVarBool       contained invmaildir_trash invmark_old invmarkers invmenu_scroll invmeta_key invmetoo
115 syn keyword muttrcVarBool       contained invmh_purge invmime_forward_decode invpager_stop invpgp_autoencrypt invpgp_autosign
116 syn keyword muttrcVarBool       contained invpgp_ignore_subkeys invpgp_long_ids invpgp_replyencrypt invpgp_replysign
117 syn keyword muttrcVarBool       contained invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable invpgp_strict_enc
118 syn keyword muttrcVarBool       contained invpipe_decode invpipe_split invpop_auth_try_all invpop_last invprint_decode
119 syn keyword muttrcVarBool       contained invprint_split invprompt_after invread_only invreply_self invresolve invreverse_alias
120 syn keyword muttrcVarBool       contained invreverse_name invreverse_realname invrfc2047_parameters invsave_address invsave_empty
121 syn keyword muttrcVarBool       contained invsave_name invscore invsig_dashes invsig_on_top invsmart_wrap invsort_re
122 syn keyword muttrcVarBool       contained invssl_use_sslv2 invssl_use_sslv3 invssl_use_tlsv1 invssl_usesystemcerts
123 syn keyword muttrcVarBool       contained invstatus_on_top invstrict_threads invsuspend invtext_flowed invthorough_search
124 syn keyword muttrcVarBool       contained invthread_received invtilde invuncollapse_jump invuse_8bitmime invuse_domain invuse_from
125 syn keyword muttrcVarBool       contained invuse_ipv6 invuser_agent invwait_key invweed invwrap_search invwrite_bcc
126
127 " start mutt-ng specific keywords
128 syn keyword muttrcVarBool       contained ask_follow_up nntp_ask_x_comment_to maildir_header_cache_verify nntp_load_description
129 syn keyword muttrcVarBool       contained quote_empty quote_quoted nntp_save_unsubscribed sidebar_shorten_hierarchy nntp_show_new_news
130 syn keyword muttrcVarBool       contained nntp_show_only_unread sidebar_visible strict_mime stuff_quoted trash nntp_x_comment_to
131 syn keyword muttrcVarBool       contained xterm_set_titles
132 " end mutt-ng specific keywords
133
134 syn keyword muttrcVarQuad       contained abort_nosubject abort_unmodified copy delete honor_followup_to include mime_forward
135 syn keyword muttrcVarQuad       contained mime_forward_rest mime_forward move pgp_autoinline crypt_verify_sig pop_delete
136 syn keyword muttrcVarQuad       contained pop_reconnect postpone print quit recall reply_to ssl_starttls
137
138 syn keyword muttrcVarQuad       contained noabort_nosubject noabort_unmodified nocopy nodelete nohonor_followup_to
139 syn keyword muttrcVarQuad       contained noinclude nomime_forward nocontained nomime_forward_rest nomime_fwd nomove
140 syn keyword muttrcVarQuad       contained nopgp_create_traditional nopgp_verify_sig nopop_delete nopop_reconnect
141 syn keyword muttrcVarQuad       contained nopostpone noprint noquit norecall noreply_to nossl_starttls
142
143 syn keyword muttrcVarQuad       contained invabort_nosubject invabort_unmodified invcopy invdelete invhonor_followup_to
144 syn keyword muttrcVarQuad       contained invinclude invmime_forward invcontained invmime_forward_rest invmime_fwd invmove
145 syn keyword muttrcVarQuad       contained invpgp_create_traditional invpgp_verify_sig invpop_delete invpop_reconnect
146 syn keyword muttrcVarQuad       contained invpostpone invprint invquit invrecall invreply_to invssl_starttls
147
148 " start mutt-ng specific keywords
149 syn keyword muttrcVarQuad       contained nntp_catchup nntp_followup_to_poster imap_reconnect nntp_reconnect nntp_post_moderated
150 " end mutt-ng specific keywords
151
152 syn keyword muttrcVarNum        contained connect_timeout history imap_keepalive mail_check pager_context pager_index_lines
153 syn keyword muttrcVarNum        contained pgp_timeout pop_mail_check read_inc score_threshold_delete score_threshold_flag
154 syn keyword muttrcVarNum        contained score_threshold_read sendmail_wait sleep_time timeout wrapmargin write_inc
155
156 " start mutt-ng specific keywords
157 syn keyword muttrcVarNum        contained max_line_length nntp_context nntp_mail_check sidebar_width smtp_port umask
158 " end mutt-ng specific keywords
159
160 syn keyword muttrcVarStr        contained alias_file alias_format alternates attach_format attach_sep attribution certificate_file
161 syn keyword muttrcVarStr        contained charset compose_format date_format default_hook display_filter dotlock_program dsn_notify
162 syn keyword muttrcVarStr        contained dsn_return editor entropy_file escape folder folder_format forward_format forward_format
163 syn keyword muttrcVarStr        contained from gecos_mask index_format hostname imap_authenticators imap_delim_chars
164 syn keyword muttrcVarStr        contained imap_home_namespace imap_pass imap_user indent_string indent_string index_format ispell
165 syn keyword muttrcVarStr        contained locale mailcap_path mask mbox mbox_type message_format mh_seq_flagged mh_seq_replied
166 syn keyword muttrcVarStr        contained mh_seq_unseen mix_entry_format mixmaster message_format pager pager_format
167 syn keyword muttrcVarStr        contained pgp_clearsign_command pgp_decode_command pgp_decrypt_command pgp_encrypt_only_command
168 syn keyword muttrcVarStr        contained pgp_encrypt_sign_command pgp_entry_format pgp_export_command pgp_getkeys_command
169 syn keyword muttrcVarStr        contained pgp_good_sign pgp_import_command pgp_list_pubring_command pgp_list_secring_command
170 syn keyword muttrcVarStr        contained pgp_sign_as pgp_sign_command pgp_sort_keys pgp_verify_command pgp_verify_key_command
171 syn keyword muttrcVarStr        contained pipe_sep pop_authenticators pop_host pop_pass pop_user post_indent_string post_indent_string
172 syn keyword muttrcVarStr        contained postponed preconnect print_command print_command query_command quote_regexp realname record
173 syn keyword muttrcVarStr        contained reply_regexp send_charset sendmail shell signature simple_search smileys sort sort_alias
174 syn keyword muttrcVarStr        contained sort_aux sort_browser spoolfile status_chars status_format tmpdir to_chars tunnel visual
175
176 " start mutt-ng specific keywords
177 syn keyword muttrcVarStr        contained assumed_charset file_charset nntp_group_index_format header_cache indent_string nntp_inews
178 syn keyword muttrcVarStr        contained msgid_format nntp_pass nntp_cache_dir nntp_host nntp_newsrc nntp_user operating_system
179 syn keyword muttrcVarStr        contained sidebar_delim signoff_string smtp_pass smtp_user smtp_host xterm_icon
180 syn keyword muttrcVarStr        contained xterm_title
181 " end mutt-ng specific keywords
182
183 syn keyword muttrcMenu          contained alias attach browser compose editor index pager postpone pgp mix query generic
184
185 syn keyword muttrcCommand       account-hook auto_view alternative_order charset-hook uncolor exec fcc-hook fcc-save-hook
186 syn keyword muttrcCommand       folder-hook hdr_order iconv-hook ignore lists mailboxes message-hook mbox-hook my_hdr
187 syn keyword muttrcCommand       pgp-hook push save-hook score send-hook source subscribe unalias unauto_view unhdr_order
188 syn keyword muttrcCommand       unhook unignore unlists unmono unmy_hdr unscore unsubscribe
189
190 " start mutt-ng specific keywords
191 syn keyword muttrcCommand       append-hook close-hook open-hook
192 " end mutt-ng specific keywords
193
194 syn keyword muttrcSet           set     skipwhite nextgroup=muttrcVar.*
195 syn keyword muttrcUnset         unset   skipwhite nextgroup=muttrcVar.*
196 syn keyword muttrcReset         reset   skipwhite nextgroup=muttrcVar.*
197 syn keyword muttrcToggle        toggle  skipwhite nextgroup=muttrcVar.*
198
199 syn keyword muttrcBind          contained bind          skipwhite nextgroup=muttrcMenu
200 syn match   muttrcBindLine      "^\s*bind\s\+\S\+"      skipwhite nextgroup=muttrcKey\(Name\)\= contains=muttrcBind
201
202 syn keyword muttrcMacro         contained macro         skipwhite nextgroup=muttrcMenu
203 syn match   muttrcMacroLine     "^\s*macro\s\+\S\+"     skipwhite nextgroup=muttrcKey\(Name\)\= contains=muttrcMacro
204
205 syn keyword muttrcAlias         contained alias
206 syn match   muttrcAliasLine     "^\s*alias\s\+\S\+" contains=muttrcAlias
207
208 " Colour definitions takes object, foreground and background arguments (regexps excluded).
209 syn keyword muttrcColorField    contained attachment body bold error hdrdefault header index
210 syn keyword muttrcColorField    contained indicator markers message normal quoted search signature
211 syn keyword muttrcColorField    contained status tilde tree underline
212 " start mutt-ng specific keywords
213 syn keyword muttrcColorField    contained sidebar_new sidebar_flagged sidebar
214 " end mutt-ng specific keywords
215 syn match   muttrcColorField    contained "\<quoted\d\=\>"
216 syn keyword muttrcColorFG       contained black blue cyan default green magenta red white yellow
217 syn keyword muttrcColorFG       contained brightblack brightblue brightcyan brightdefault brightgreen
218 syn keyword muttrcColorFG       contained brightmagenta brightred brightwhite brightyellow
219 syn match   muttrcColorFG       contained "\<\(bright\)\=color\d\{1,2}\>"
220 syn keyword muttrcColorBG       contained black blue cyan default green magenta red white yellow
221 syn match   muttrcColorBG       contained "\<color\d\{1,2}\>"
222 " Now for the match
223 syn keyword muttrcColor         contained color                 skipwhite nextgroup=muttrcColorField
224 syn match   muttrcColorInit     contained "^\s*color\s\+\S\+"   skipwhite nextgroup=muttrcColorFG contains=muttrcColor
225 syn match   muttrcColorLine     "^\s*color\s\+\S\+\s\+\S"       skipwhite nextgroup=muttrcColorBG contains=muttrcColorInit
226
227 " Mono are almost like color (ojects inherited from color)
228 syn keyword muttrcMonoAttrib    contained bold none normal reverse standout underline
229 syn keyword muttrcMono          contained mono          skipwhite nextgroup=muttrcColorField
230 syn match   muttrcMonoLine      "^\s*mono\s\+\S\+"      skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono
231
232 " Define the default highlighting.
233 " For version 5.7 and earlier: only when not done already
234 " For version 5.8 and later: only when an item doesn't have highlighting yet
235 if version >= 508 || !exists("did_muttrc_syntax_inits")
236   if version < 508
237     let did_muttrc_syntax_inits = 1
238     command -nargs=+ HiLink hi link <args>
239   else
240     command -nargs=+ HiLink hi def link <args>
241   endif
242
243   HiLink muttrcComment          Comment
244   HiLink muttrcEscape           SpecialChar
245   HiLink muttrcString           String
246   HiLink muttrcSpecial          Special
247   HiLink muttrcNumber           Number
248   HiLink muttrcQuadopt          Boolean
249   HiLink muttrcEmail            Special
250   HiLink muttrcHeader           Type
251   HiLink muttrcKeySpecial       SpecialChar
252   HiLink muttrcKey              Type
253   HiLink muttrcKeyName          Macro
254   HiLink muttrcVarBool          Identifier
255   HiLink muttrcVarQuad          Identifier
256   HiLink muttrcVarNum           Identifier
257   HiLink muttrcVarStr           Identifier
258   HiLink muttrcMenu             Identifier
259   HiLink muttrcCommand          Keyword
260   HiLink muttrcSet              muttrcCommand
261   HiLink muttrcUnset            muttrcCommand
262   HiLink muttrcReset            muttrcCommand
263   HiLink muttrcToggle           muttrcCommand
264   HiLink muttrcBind             muttrcCommand
265   HiLink muttrcMacro            muttrcCommand
266   HiLink muttrcAlias            muttrcCommand
267   HiLink muttrcAliasLine        Identifier
268   HiLink muttrcColorField       Identifier
269   HiLink muttrcColorFG          String
270   HiLink muttrcColorBG          muttrcColorFG
271   HiLink muttrcColor            muttrcCommand
272   HiLink muttrcMonoAttrib       muttrcColorFG
273   HiLink muttrcMono             muttrcCommand
274
275   delcommand HiLink
276 endif
277
278 let b:current_syntax = "muttrc"
279
280 "EOF    vim: ts=8 noet tw=100 sw=8 sts=0