From 8b3f95de903e2bc331806084f29cd2de992db726 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 29 Oct 2017 21:28:42 +0100 Subject: [PATCH] Add local ftdetect and syntax --- ftdetect/cocor.vim | 2 + ftdetect/markdown.vim | 3 + ftdetect/neomutt.vim | 1 + ftdetect/octave.vim | 2 + ftdetect/sieve.vim | 1 + ftdetect/tolua.vim | 1 + ftdetect/xwiki.vim | 2 + syntax/neomutt.vim | 969 ++++++++++++++++++++++++++++++ syntax/tex.vim | 1326 +++++++++++++++++++++++++++++++++++++++++ syntax/tolua.vim | 41 ++ syntax/xwiki.vim | 52 ++ 11 files changed, 2400 insertions(+) create mode 100644 ftdetect/cocor.vim create mode 100644 ftdetect/markdown.vim create mode 100644 ftdetect/neomutt.vim create mode 100644 ftdetect/octave.vim create mode 100644 ftdetect/sieve.vim create mode 100644 ftdetect/tolua.vim create mode 100644 ftdetect/xwiki.vim create mode 100644 syntax/neomutt.vim create mode 100644 syntax/tex.vim create mode 100644 syntax/tolua.vim create mode 100644 syntax/xwiki.vim diff --git a/ftdetect/cocor.vim b/ftdetect/cocor.vim new file mode 100644 index 0000000..4f00515 --- /dev/null +++ b/ftdetect/cocor.vim @@ -0,0 +1,2 @@ +au! BufRead,BufNewFile *.atg setfiletype coco +au! BufRead,BufNewFile *.wili setfiletype wili diff --git a/ftdetect/markdown.vim b/ftdetect/markdown.vim new file mode 100644 index 0000000..cdf3ea4 --- /dev/null +++ b/ftdetect/markdown.vim @@ -0,0 +1,3 @@ +au! BufNewFile,BufRead *.text set ft=markdown syntax=markdown + +au! BufRead,BufNewFile *.md set ft=markdown syntax=markdown diff --git a/ftdetect/neomutt.vim b/ftdetect/neomutt.vim new file mode 100644 index 0000000..a4363fd --- /dev/null +++ b/ftdetect/neomutt.vim @@ -0,0 +1 @@ +au! BufNewFile,BufRead neomuttrc set ft=neomutt syntax=neomutt diff --git a/ftdetect/octave.vim b/ftdetect/octave.vim new file mode 100644 index 0000000..39e0ab7 --- /dev/null +++ b/ftdetect/octave.vim @@ -0,0 +1,2 @@ +au! BufNewFile,BufRead *.m setf octave +au! BufNewFile,BufRead *.m set syntax=matlab diff --git a/ftdetect/sieve.vim b/ftdetect/sieve.vim new file mode 100644 index 0000000..4c68082 --- /dev/null +++ b/ftdetect/sieve.vim @@ -0,0 +1 @@ +au! BufNewFile,BufRead *.sieve set ft=sieve syntax=sieve diff --git a/ftdetect/tolua.vim b/ftdetect/tolua.vim new file mode 100644 index 0000000..87cb3fd --- /dev/null +++ b/ftdetect/tolua.vim @@ -0,0 +1 @@ +au! BufRead,BufNewFile tolua_*.pkg set ft=tolua syntax=tolua diff --git a/ftdetect/xwiki.vim b/ftdetect/xwiki.vim new file mode 100644 index 0000000..b6a1640 --- /dev/null +++ b/ftdetect/xwiki.vim @@ -0,0 +1,2 @@ +au! BufNewFile,BufRead *.xwiki set ft=xwiki syntax=xwiki + diff --git a/syntax/neomutt.vim b/syntax/neomutt.vim new file mode 100644 index 0000000..30beb88 --- /dev/null +++ b/syntax/neomutt.vim @@ -0,0 +1,969 @@ +" Vim syntax file +" Language: Mutt setup files +" Original: Preben 'Peppe' Guldberg +" Maintainer: Kyle Wheeler +" Last Change: 18 August 2016 + +" This file covers mutt version 1.7.0 and NeoMutt 20170306 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" Set the keyword characters +setlocal isk=@,48-57,_,- + +" handling optional variables +if !exists("use_mutt_sidebar") + let use_mutt_sidebar=0 +endif + +syn match muttrcComment "^# .*$" contains=@Spell +syn match muttrcComment "^#[^ ].*$" +syn match muttrcComment "^#$" +syn match muttrcComment "[^\\]#.*$"lc=1 + +" Escape sequences (back-tick and pipe goes here too) +syn match muttrcEscape +\\[#tnr"'Cc ]+ +syn match muttrcEscape +[`|]+ +syn match muttrcEscape +\\$+ + +" The variables takes the following arguments +"syn match muttrcString contained "=\s*[^ #"'`]\+"lc=1 contains=muttrcEscape +syn region muttrcString contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString +syn region muttrcString contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction +syn match muttrcStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcString,muttrcStringNL + +syn region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand + +syn match muttrcRXChars contained /[^\\][][.*?+]\+/hs=s+1 +syn match muttrcRXChars contained /[][|()][.*?+]*/ +syn match muttrcRXChars contained /['"]^/ms=s+1 +syn match muttrcRXChars contained /$['"]/me=e-1 +syn match muttrcRXChars contained /\\/ +" Why does muttrcRXString2 work with one \ when muttrcRXString requires two? +syn region muttrcRXString contained skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars +syn region muttrcRXString contained skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars +syn region muttrcRXString contained skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars +" For some reason, skip refuses to match backslashes here... +syn region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXChars +syn region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXChars +syn region muttrcRXString2 contained skipwhite start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars +syn region muttrcRXString2 contained skipwhite start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars + +" these must be kept synchronized with muttrcRXString, but are intended for +" muttrcRXHooks +syn region muttrcRXHookString contained keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syn region muttrcRXHookString contained keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syn region muttrcRXHookString contained keepend skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syn region muttrcRXHookString contained keepend skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syn region muttrcRXHookString contained keepend matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syn match muttrcRXHookStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL + +" these are exclusively for args lists (e.g. -rx pat pat pat ...) +syn region muttrcRXPat contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat +syn region muttrcRXPat contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat +syn match muttrcRXPat contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat +syn match muttrcRXDef contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat + +syn match muttrcSpecial +\(['"]\)!\1+ + +syn match muttrcSetStrAssignment contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syn region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString +syn region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString +syn match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syn match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syn match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetNumAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syn match muttrcSetNumAssignment contained skipwhite /=\s*\d\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetNumAssignment contained skipwhite /=\s*"\d\+"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" Now catch some email addresses and headers (purified version from mail.vim) +syn match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+" +syn match muttrcHeader "\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" + +syn match muttrcKeySpecial contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+ +syn match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName +syn region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial,muttrcKeyName +syn region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial,muttrcKeyName +syn match muttrcKeyName contained "\" +syn match muttrcKeyName contained "\\[trne]" +syn match muttrcKeyName contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" +syn match muttrcKeyName contained "" + +syn keyword muttrcVarBool skipwhite contained + \ allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split + \ auto_tag autoedit beep beep_new bounce_delivered braille_friendly + \ check_mbox_size check_new collapse_unread confirmappend confirmcreate + \ crypt_autoencrypt crypt_autopgp crypt_autosign crypt_autosmime + \ crypt_confirmhook crypt_opportunistic_encrypt crypt_replyencrypt + \ crypt_replysign crypt_replysignencrypted crypt_timestamp crypt_use_gpgme + \ crypt_use_pka delete_untag digest_collapse duplicate_threads + \ edit_headers encode_from fast_reply fcc_clear followup_to + \ force_name forward_decode forward_decrypt + \ forward_quote hdrs header help hidden_host hide_limited hide_missing + \ hide_thread_subject hide_top_limited hide_top_missing honor_disposition + \ idn_decode idn_encode ignore_linear_white_space ignore_list_reply_to + \ imap_check_subscribed imap_list_subscribed imap_passive imap_peek + \ imap_servernoise implicit_autoview include_onlyfirst keep_flagged + \ mail_check_recent mail_check_stats mailcap_sanitize maildir_check_cur + \ maildir_header_cache_verify maildir_trash mark_old markers menu_move_off + \ menu_scroll message_cache_clean meta_key metoo mh_purge mime_forward_decode + \ narrow_tree pager_stop pgp_auto_decode + \ pgp_autoinline pgp_check_exit + \ pgp_ignore_subkeys pgp_long_ids pgp_replyinline + \ pgp_retainable_sigs pgp_show_unusable pgp_strict_enc + \ pgp_use_gpg_agent pipe_decode pipe_split pop_auth_try_all pop_last + \ postpone_encrypt postpone_encrypt_as print_decode print_split prompt_after + \ read_only reflow_space_quotes reflow_text reflow_wrap reply_self resolve + \ resume_draft_files resume_edited_draft_files reverse_alias reverse_name + \ reverse_realname rfc2047_parameters save_address save_empty save_name score + \ sidebar_folder_indent sidebar_new_mail_only sidebar_next_new_wrap + \ sidebar_short_path sidebar_sort sidebar_visible sig_dashes sig_on_top + \ smart_wrap smime_ask_cert_label smime_decrypt_use_default_key smime_is_default + \ sort_re ssl_force_tls ssl_use_sslv2 ssl_use_sslv3 ssl_use_tlsv1 + \ ssl_usesystemcerts ssl_verify_dates ssl_verify_host status_on_top strict_mime + \ strict_threads suspend text_flowed thorough_search thread_received tilde + \ ts_enabled uncollapse_jump use_8bitmime use_domain use_envelope_from use_from + \ use_idn use_ipv6 user_agent wait_key weed wrap_search write_bcc + \ nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarBool skipwhite contained + \ noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc noaskcc noattach_split + \ noauto_tag noautoedit nobeep nobeep_new nobounce_delivered nobraille_friendly + \ nocheck_mbox_size nocheck_new nocollapse_unread noconfirmappend noconfirmcreate + \ nocrypt_autoencrypt nocrypt_autopgp nocrypt_autosign nocrypt_autosmime + \ nocrypt_confirmhook nocrypt_opportunistic_encrypt nocrypt_replyencrypt + \ nocrypt_replysign nocrypt_replysignencrypted nocrypt_timestamp nocrypt_use_gpgme + \ nocrypt_use_pka nodelete_untag nodigest_collapse noduplicate_threads noedit_hdrs + \ noedit_headers noencode_from noenvelope_from nofast_reply nofcc_clear nofollowup_to + \ noforce_name noforw_decode noforw_decrypt noforw_quote noforward_decode noforward_decrypt + \ noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nohide_missing + \ nohide_thread_subject nohide_top_limited nohide_top_missing nohonor_disposition + \ noidn_decode noidn_encode noignore_linear_white_space noignore_list_reply_to + \ noimap_check_subscribed noimap_list_subscribed noimap_passive noimap_peek + \ noimap_servernoise noimplicit_autoview noinclude_onlyfirst nokeep_flagged + \ nomail_check_recent nomail_check_stats nomailcap_sanitize nomaildir_check_cur + \ nomaildir_header_cache_verify nomaildir_trash nomark_old nomarkers nomenu_move_off + \ nomenu_scroll nomessage_cache_clean nometa_key nometoo nomh_purge nomime_forward_decode + \ nonarrow_tree nopager_stop nopgp_auto_decode nopgp_auto_traditional nopgp_autoencrypt + \ nopgp_autoinline nopgp_autosign nopgp_check_exit nopgp_create_traditional + \ nopgp_ignore_subkeys nopgp_long_ids nopgp_replyencrypt nopgp_replyinline nopgp_replysign + \ nopgp_replysignencrypted nopgp_retainable_sigs nopgp_show_unusable nopgp_strict_enc + \ nopgp_use_gpg_agent nopipe_decode nopipe_split nopop_auth_try_all nopop_last + \ nopostpone_encrypt nopostpone_encrypt_as noprint_decode noprint_split noprompt_after + \ noread_only noreflow_space_quotes noreflow_text noreflow_wrap noreply_self noresolve + \ noresume_draft_files noresume_edited_draft_files noreverse_alias noreverse_name + \ noreverse_realname norfc2047_parameters nosave_address nosave_empty nosave_name noscore + \ nosidebar_folder_indent nosidebar_new_mail_only nosidebar_next_new_wrap + \ nosidebar_short_path nosidebar_sort nosidebar_visible nosig_dashes nosig_on_top + \ nosmart_wrap nosmime_ask_cert_label nosmime_decrypt_use_default_key nosmime_is_default + \ nosort_re nossl_force_tls nossl_use_sslv2 nossl_use_sslv3 nossl_use_tlsv1 + \ nossl_usesystemcerts nossl_verify_dates nossl_verify_host nostatus_on_top nostrict_mime + \ nostrict_threads nosuspend notext_flowed nothorough_search nothread_received notilde + \ nots_enabled nouncollapse_jump nouse_8bitmime nouse_domain nouse_envelope_from nouse_from + \ nouse_idn nouse_ipv6 nouser_agent nowait_key noweed nowrap_search nowrite_bcc + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarBool skipwhite contained + \ invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc invaskcc invattach_split + \ invauto_tag invautoedit invbeep invbeep_new invbounce_delivered invbraille_friendly + \ invcheck_mbox_size invcheck_new invcollapse_unread invconfirmappend invconfirmcreate + \ invcrypt_autoencrypt invcrypt_autopgp invcrypt_autosign invcrypt_autosmime + \ invcrypt_confirmhook invcrypt_opportunistic_encrypt invcrypt_replyencrypt + \ invcrypt_replysign invcrypt_replysignencrypted invcrypt_timestamp invcrypt_use_gpgme + \ invcrypt_use_pka invdelete_untag invdigest_collapse invduplicate_threads invedit_hdrs + \ invedit_headers invencode_from invenvelope_from invfast_reply invfcc_clear invfollowup_to + \ invforce_name invforw_decode invforw_decrypt invforw_quote invforward_decode invforward_decrypt + \ invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited invhide_missing + \ invhide_thread_subject invhide_top_limited invhide_top_missing invhonor_disposition + \ invidn_decode invidn_encode invignore_linear_white_space invignore_list_reply_to + \ invimap_check_subscribed invimap_list_subscribed invimap_passive invimap_peek + \ invimap_servernoise invimplicit_autoview invinclude_onlyfirst invkeep_flagged + \ invmail_check_recent invmail_check_stats invmailcap_sanitize invmaildir_check_cur + \ invmaildir_header_cache_verify invmaildir_trash invmark_old invmarkers invmenu_move_off + \ invmenu_scroll invmessage_cache_clean invmeta_key invmetoo invmh_purge invmime_forward_decode + \ invnarrow_tree invpager_stop invpgp_auto_decode invpgp_auto_traditional invpgp_autoencrypt + \ invpgp_autoinline invpgp_autosign invpgp_check_exit invpgp_create_traditional + \ invpgp_ignore_subkeys invpgp_long_ids invpgp_replyencrypt invpgp_replyinline invpgp_replysign + \ invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable invpgp_strict_enc + \ invpgp_use_gpg_agent invpipe_decode invpipe_split invpop_auth_try_all invpop_last + \ invpostpone_encrypt invpostpone_encrypt_as invprint_decode invprint_split invprompt_after + \ invread_only invreflow_space_quotes invreflow_text invreflow_wrap invreply_self invresolve + \ invresume_draft_files invresume_edited_draft_files invreverse_alias invreverse_name + \ invreverse_realname invrfc2047_parameters invsave_address invsave_empty invsave_name invscore + \ invsidebar_folder_indent invsidebar_new_mail_only invsidebar_next_new_wrap + \ invsidebar_short_path invsidebar_sort invsidebar_visible invsig_dashes invsig_on_top + \ invsmart_wrap invsmime_ask_cert_label invsmime_decrypt_use_default_key invsmime_is_default + \ invsort_re invssl_force_tls invssl_use_sslv2 invssl_use_sslv3 invssl_use_tlsv1 + \ invssl_usesystemcerts invssl_verify_dates invssl_verify_host invstatus_on_top invstrict_mime + \ invstrict_threads invsuspend invtext_flowed invthorough_search invthread_received invtilde + \ invts_enabled invuncollapse_jump invuse_8bitmime invuse_domain invuse_envelope_from invuse_from + \ invuse_idn invuse_ipv6 invuser_agent invwait_key invweed invwrap_search invwrite_bcc + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarQuad skipwhite contained + \ abort_nosubject abort_unmodified bounce copy crypt_verify_sig delete + \ fcc_attach forward_edit honor_followup_to include mime_forward + \ mime_forward_rest move pgp_mime_auto pop_delete + \ pop_reconnect postpone print quit recall reply_to ssl_starttls + \ nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarQuad skipwhite contained + \ noabort_nosubject noabort_unmodified nobounce nocopy nocrypt_verify_sig nodelete + \ nofcc_attach noforward_edit nohonor_followup_to noinclude nomime_forward + \ nomime_forward_rest nomime_fwd nomove nopgp_mime_auto nopgp_verify_sig nopop_delete + \ nopop_reconnect nopostpone noprint noquit norecall noreply_to nossl_starttls + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarQuad skipwhite contained + \ invabort_nosubject invabort_unmodified invbounce invcopy invcrypt_verify_sig invdelete + \ invfcc_attach invforward_edit invhonor_followup_to invinclude invmime_forward + \ invmime_forward_rest invmime_fwd invmove invpgp_mime_auto invpgp_verify_sig invpop_delete + \ invpop_reconnect invpostpone invprint invquit invrecall invreply_to invssl_starttls + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarNum skipwhite contained + \ connect_timeout history imap_keepalive imap_pipeline_depth mail_check + \ mail_check_stats_interval menu_context net_inc pager_context pager_index_lines + \ pgp_timeout pop_checkinterval read_inc save_history score_threshold_delete + \ score_threshold_flag score_threshold_read search_context sendmail_wait + \ sidebar_width sleep_time smime_timeout ssl_min_dh_prime_bits time_inc timeout + \ wrap wrap_headers wrapmargin write_inc + \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn match muttrcFormatErrors contained /%./ + +syn match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVvWwXxYyZz+%]/ +syn match muttrcStrftimeEscapes contained /%E[cCxXyY]/ +syn match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/ + +syn region muttrcIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcQueryFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcAliasFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcAliasFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcAttachFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcAttachFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcComposeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcComposeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcFolderFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcFolderFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcMixFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcMixFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcPGPFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcPGPFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcPGPCmdFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcPGPCmdFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcStatusFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcStatusFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcPGPGetKeysFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcPGPGetKeysFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcSmimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcSmimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcStrftimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn region muttrcStrftimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" The following info was pulled from hdr_format_str in hdrline.c +syn match muttrcIndexFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[aAbBcCdDeEfFHilLmMnNOPsStTuvXyYZ%]/ +syn match muttrcIndexFormatEscapes contained /%[>|*]./ +syn match muttrcIndexFormatConditionals contained /%?[EFHlLMNOXyY]?/ nextgroup=muttrcFormatConditionals2 +" The following info was pulled from alias_format_str in addrbook.c +syn match muttrcAliasFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[afnrt%]/ +" The following info was pulled from query_format_str in query.c +syn match muttrcQueryFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[acent%]/ +syn match muttrcQueryFormatConditionals contained /%?[e]?/ nextgroup=muttrcFormatConditionals2 +" The following info was pulled from mutt_attach_fmt in recvattach.c +syn match muttrcAttachFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CcDdefImMnQstTuX%]/ +syn match muttrcAttachFormatEscapes contained /%[>|*]./ +syn match muttrcAttachFormatConditionals contained /%?[CcdDefInmMQstTuX]?/ nextgroup=muttrcFormatConditionals2 +syn match muttrcFormatConditionals2 contained /[^?]*?/ +" The following info was pulled from compose_format_str in compose.c +syn match muttrcComposeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ahlv%]/ +syn match muttrcComposeFormatEscapes contained /%[>|*]./ +" The following info was pulled from folder_format_str in browser.c +syn match muttrcFolderFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CDdfFglNstu%]/ +syn match muttrcFolderFormatEscapes contained /%[>|*]./ +syn match muttrcFolderFormatConditionals contained /%?[N]?/ +" The following info was pulled from mix_entry_fmt in remailer.c +syn match muttrcMixFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ncsa%]/ +syn match muttrcMixFormatConditionals contained /%?[ncsa]?/ +" The following info was pulled from crypt_entry_fmt in crypt_gpgme.c +" and pgp_entry_fmt in pgpkey.c (note that crypt_entry_fmt supports +" 'p', but pgp_entry_fmt does not). +syn match muttrcPGPFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[nkualfctp%]/ +syn match muttrcPGPFormatConditionals contained /%?[nkualfct]?/ +" The following info was pulled from _mutt_fmt_pgp_command in +" pgpinvoke.c +syn match muttrcPGPCmdFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[pfsar%]/ +syn match muttrcPGPCmdFormatConditionals contained /%?[pfsar]?/ nextgroup=muttrcFormatConditionals2 +" The following info was pulled from status_format_str in status.c +syn match muttrcStatusFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[bdfFhlLmMnopPrsStuvV%]/ +syn match muttrcStatusFormatEscapes contained /%[>|*]./ +syn match muttrcStatusFormatConditionals contained /%?[bdFlLmMnoptuV]?/ nextgroup=muttrcFormatConditionals2 +" This matches the documentation, but directly contradicts the code +" (according to the code, this should be identical to the +" muttrcPGPCmdFormatEscapes +syn match muttrcPGPGetKeysFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[r%]/ +" The following info was pulled from _mutt_fmt_smime_command in +" smime.c +syn match muttrcSmimeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[Cciskaf%]/ +syn match muttrcSmimeFormatConditionals contained /%?[Cciskaf]?/ nextgroup=muttrcFormatConditionals2 + +syn region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes +syn region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes +syn region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes +syn region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes +syn region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes + +syn keyword muttrcVarStr contained skipwhite attribution index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt +syn match muttrcVarEqualsIdxFmt contained skipwhite "=" nextgroup=muttrcIndexFormatStr +syn keyword muttrcVarStr contained skipwhite alias_format nextgroup=muttrcVarEqualsAliasFmt +syn match muttrcVarEqualsAliasFmt contained skipwhite "=" nextgroup=muttrcAliasFormatStr +syn keyword muttrcVarStr contained skipwhite attach_format nextgroup=muttrcVarEqualsAttachFmt +syn match muttrcVarEqualsAttachFmt contained skipwhite "=" nextgroup=muttrcAttachFormatStr +syn keyword muttrcVarStr contained skipwhite compose_format nextgroup=muttrcVarEqualsComposeFmt +syn match muttrcVarEqualsComposeFmt contained skipwhite "=" nextgroup=muttrcComposeFormatStr +syn keyword muttrcVarStr contained skipwhite folder_format nextgroup=muttrcVarEqualsFolderFmt +syn match muttrcVarEqualsFolderFmt contained skipwhite "=" nextgroup=muttrcFolderFormatStr +syn keyword muttrcVarStr contained skipwhite mix_entry_format nextgroup=muttrcVarEqualsMixFmt +syn match muttrcVarEqualsMixFmt contained skipwhite "=" nextgroup=muttrcMixFormatStr +syn keyword muttrcVarStr contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt +syn match muttrcVarEqualsPGPFmt contained skipwhite "=" nextgroup=muttrcPGPFormatStr +syn keyword muttrcVarStr contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFmt +syn match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr +syn 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 +syn match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr +syn keyword muttrcVarStr contained skipwhite ts_icon_format ts_status_format status_format nextgroup=muttrcVarEqualsStatusFmt +syn match muttrcVarEqualsStatusFmt contained skipwhite "=" nextgroup=muttrcStatusFormatStr +syn keyword muttrcVarStr contained skipwhite pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt +syn match muttrcVarEqualsPGPGetKeysFmt contained skipwhite "=" nextgroup=muttrcPGPGetKeysFormatStr +syn 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 +syn match muttrcVarEqualsSmimeFmt contained skipwhite "=" nextgroup=muttrcSmimeFormatStr +syn keyword muttrcVarStr contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFmt +syn match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=muttrcStrftimeFormatStr + +syn match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn match muttrcVarStr contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcVarStr contained skipwhite + \ alias_file assumed_charset attach_charset attach_sep certificate_file charset + \ config_charset content_type default_hook display_filter + \ dsn_notify dsn_return editor entropy_file envelope_from_address escape folder + \ forward_format from gecos_mask header_cache + \ header_cache_compress header_cache_pagesize history_file hostname + \ imap_authenticators imap_delim_chars imap_headers imap_idle imap_login + \ imap_pass imap_user indent_string ispell locale mailcap_path mask + \ mbox mbox_type message_cachedir mh_seq_flagged mh_seq_replied mh_seq_unseen + \ mixmaster pager pgp_decryption_okay pgp_good_sign + \ pgp_mime_signature_description pgp_mime_signature_filename pgp_sign_as + \ pgp_sort_keys pipe_sep pop_authenticators pop_host pop_pass pop_user + \ post_indent_string postpone_encrypt_as postponed preconnect + \ print_command query_command quote_regexp realname record + \ reply_regexp send_charset sendmail shell sidebar_delim sidebar_delim_chars + \ sidebar_divider_char sidebar_format sidebar_indent_string sidebar_sort_method + \ signature simple_search smileys smime_ca_location smime_certificates + \ smime_default_key smime_encrypt_with smime_keys + \ smime_sign_digest_alg smtp_authenticators smtp_pass smtp_url sort sort_alias + \ sort_aux sort_browser spam_separator spoolfile ssl_ca_certificates_file + \ ssl_ciphers ssl_client_cert status_chars tmpdir to_chars trash ts_icon_format + \ ts_status_format tunnel visual + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcVarBool contained skipwhite imap_force_ssl noimap_force_ssl invimap_force_ssl nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +"syn keyword muttrcVarQuad contained nopgp_create_traditional invpgp_create_traditional +syn keyword muttrcVarStr contained skipwhite alternates nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syn keyword muttrcMenu contained alias attach browser compose editor index pager postpone pgp mix query generic +syn match muttrcMenuList "\S\+" contained contains=muttrcMenu +syn match muttrcMenuCommas /,/ contained + +syn 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 + +syn keyword muttrcCommand skipwhite + \ alternative_order auto_view exec hdr_order iconv-hook ignore mailboxes + \ mailto_allow mime_lookup my_hdr pgp-hook push score sidebar_whitelist source + \ unalternative_order unalternative_order unauto_view ungroup unhdr_order + \ unignore unmailboxes unmailto_allow unmime_lookup unmono unmy_hdr unscore +syn keyword muttrcCommand skipwhite charset-hook nextgroup=muttrcRXString +syn keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks + +syn keyword muttrcCommand skipwhite spam nextgroup=muttrcSpamPattern +syn region muttrcSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL +syn region muttrcSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL + +syn keyword muttrcCommand skipwhite nospam nextgroup=muttrcNoSpamPattern +syn region muttrcNoSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern +syn region muttrcNoSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern + +syn match muttrcAttachmentsMimeType contained "[*a-z0-9_-]\+/[*a-z0-9._-]\+\s*" skipwhite nextgroup=muttrcAttachmentsMimeType +syn match muttrcAttachmentsFlag contained "[+-]\%([AI]\|inline\|attachment\)\s\+" skipwhite nextgroup=muttrcAttachmentsMimeType +syn match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite nextgroup=muttrcAttachmentsFlag + +syn match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)" + +syn keyword muttrcAsterisk contained * +syn keyword muttrcListsKeyword lists skipwhite nextgroup=muttrcGroupDef,muttrcComment +syn keyword muttrcListsKeyword unlists skipwhite nextgroup=muttrcAsterisk,muttrcComment + +syn keyword muttrcSubscribeKeyword subscribe nextgroup=muttrcGroupDef,muttrcComment +syn keyword muttrcSubscribeKeyword unsubscribe nextgroup=muttrcAsterisk,muttrcComment + +syn keyword muttrcAlternateKeyword contained alternates unalternates +syn region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment + +" muttrcVariable includes a prefix because partial strings are considered +" valid. +syn match muttrcVariable contained "\\\@]\+" contains=muttrcEmail +syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|purge\|recall\|resend\|save\|send\|tag\|undelete\)-message\>" +syn match muttrcFunction contained "\<\%(delete\|next\|previous\|read\|tag\|break\|undelete\)-thread\>" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\<\%(backward\|capitalize\|downcase\|forward\|kill\|upcase\)-word\>" +syn match muttrcFunction contained "\<\%(delete\|filter\|first\|last\|next\|pipe\|previous\|print\|save\|select\|tag\|undelete\)-entry\>" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" +syn 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\)\>" +syn keyword muttrcFunction contained imap-logout-all +if use_mutt_sidebar == 1 + syn match muttrcFunction contained "\]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName + +syn keyword muttrcCommand set skipwhite nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcCommand unset skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcCommand reset skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcCommand toggle skipwhite nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" First, functions that take regular expressions: +syn match muttrcRXHookNot contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL +syn match muttrcRXHooks /\<\%(account\|folder\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL + +" Now, functions that take patterns +syn match muttrcPatHookNot contained /!\s*/ skipwhite nextgroup=muttrcPattern +syn match muttrcPatHooks /\<\%(mbox\|crypt\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern +syn match muttrcPatHooks /\<\%(message\|reply\|send\|send2\|save\|\|fcc\%(-save\)\?\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern + +syn match muttrcBindFunction contained /\S\+\>/ skipwhite contains=muttrcFunction +syn match muttrcBindFunctionNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL +syn match muttrcBindKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL +syn match muttrcBindKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindKey,muttrcBindKeyNL +syn match muttrcBindMenuList contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcBindKey,muttrcBindKeyNL +syn match muttrcBindMenuListNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindMenuList,muttrcBindMenuListNL +syn keyword muttrcCommand skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL + +syn region muttrcMacroDescr contained keepend skipwhite start=+\s*\S+ms=e skip=+\\ + end=+ \|$+me=s +syn region muttrcMacroDescr contained keepend skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s +syn region muttrcMacroDescr contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s +syn match muttrcMacroDescrNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syn region muttrcMacroBody contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'\|\%(\%(\\\\\)\@]\+>/ contains=muttrcEmail nextgroup=muttrcAliasComma +syn match muttrcAliasEncEmailNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL +syn match muttrcAliasNameNoParens contained /[^<(@]\+\s\+/ nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL +syn region muttrcAliasName contained matchgroup=Type start=/(/ end=/)/ skipwhite +syn match muttrcAliasNameNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasName,muttrcAliasNameNL +syn match muttrcAliasENNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL +syn match muttrcAliasKey contained /\s*[^- \t]\S\+/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL +syn match muttrcAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL +syn keyword muttrcCommand skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL + +syn match muttrcUnAliasKey contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL +syn match muttrcUnAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL +syn keyword muttrcCommand skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL + +syn match muttrcSimplePat contained "!\?\^\?[~][ADEFgGklNOpPQRSTuUvV=$]" +syn match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s*\%([<>-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)" +syn 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 +syn match muttrcSimplePat contained "!\?\^\?[~][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatRXContainer +syn match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString +syn match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString +syn region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat +"syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXString +syn region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+ +syn region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+ +syn region muttrcSimplePatString contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 +syn region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXString +syn region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXString +syn region muttrcSimplePatRXContainer contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString +syn match muttrcSimplePatMetas contained /[(|)]/ + +syn match muttrcOptSimplePat contained skipwhite /[~=%!(^].*/ contains=muttrcSimplePat,muttrcSimplePatMetas +syn match muttrcOptSimplePat contained skipwhite /[^~=%!(^].*/ contains=muttrcRXString +syn region muttrcOptPattern contained matchgroup=Type keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL +syn region muttrcOptPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL +syn region muttrcOptPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL +syn match muttrcOptPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL +syn match muttrcOptPattern contained skipwhite /[.]/ nextgroup=muttrcString,muttrcStringNL +" Keep muttrcPattern and muttrcOptPattern synchronized +syn region muttrcPattern contained matchgroup=Type keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas +syn region muttrcPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas +syn region muttrcPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat +syn match muttrcPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat +syn match muttrcPattern contained skipwhite /[.]/ +syn region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas +syn region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas + +" Colour definitions takes object, foreground and background arguments (regexps excluded). +syn match muttrcColorMatchCount contained "[0-9]\+" +syn match muttrcColorMatchCountNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL +syn region muttrcColorRXPat contained start=+\s*'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL +syn region muttrcColorRXPat contained start=+\s*"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL +syn keyword muttrcColorField skipwhite contained + \ attachment body bold error hdrdefault header index indicator markers message + \ normal prompt quoted search sidebar-divider sidebar-flagged sidebar-highlight + \ sidebar-indicator sidebar-new sidebar-spoolfile signature status tilde tree + \ underline +syn match muttrcColorField contained "\" +if use_mutt_sidebar == 1 + syn keyword muttrcColorField contained sidebar_new +endif +syn keyword muttrcColor contained black blue cyan default green magenta red white yellow +syn keyword muttrcColor contained brightblack brightblue brightcyan brightdefault brightgreen brightmagenta brightred brightwhite brightyellow +syn match muttrcColor contained "\<\%(bright\)\=color\d\{1,3}\>" +" Now for the structure of the color line +syn match muttrcColorRXNL contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL +syn match muttrcColorBG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL +syn match muttrcColorBGNL contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL +syn match muttrcColorFG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL +syn match muttrcColorFGNL contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL +syn match muttrcColorContext contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorFG,muttrcColorFGNL +syn match muttrcColorNL contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL +syn match muttrcColorKeyword contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL +syn region muttrcColorLine keepend start=/^\s*color\s\+\%(index\|header\)\@!/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace +" Now for the structure of the color index line +syn match muttrcPatternNL contained skipnl "\s*\\$" nextgroup=muttrcPattern,muttrcPatternNL +syn match muttrcColorBGI contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcPattern,muttrcPatternNL +syn match muttrcColorBGNLI contained skipnl "\s*\\$" nextgroup=muttrcColorBGI,muttrcColorBGNLI +syn match muttrcColorFGI contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGI,muttrcColorBGNLI +syn match muttrcColorFGNLI contained skipnl "\s*\\$" nextgroup=muttrcColorFGI,muttrcColorFGNLI +syn match muttrcColorContextI contained /\s*\/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGI,muttrcColorFGNLI +syn match muttrcColorNLI contained skipnl "\s*\\$" nextgroup=muttrcColorContextI,muttrcColorNLI +syn match muttrcColorKeywordI contained skipwhite /\/ nextgroup=muttrcColorContextI,muttrcColorNLI +syn region muttrcColorLine keepend skipwhite start=/\/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordI,muttrcComment,muttrcUnHighlightSpace +" Now for the structure of the color header line +syn match muttrcRXPatternNL contained skipnl "\s*\\$" nextgroup=muttrcRXString,muttrcRXPatternNL +syn match muttrcColorBGH contained /\s*[$]\?\w\+\s*/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcRXString,muttrcRXPatternNL +syn match muttrcColorBGNLH contained skipnl "\s*\\$" nextgroup=muttrcColorBGH,muttrcColorBGNLH +syn match muttrcColorFGH contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBGH,muttrcColorBGNLH +syn match muttrcColorFGNLH contained skipnl "\s*\\$" nextgroup=muttrcColorFGH,muttrcColorFGNLH +syn match muttrcColorContextH contained /\s*\/ contains=muttrcUnHighlightSpace nextgroup=muttrcColorFGH,muttrcColorFGNLH +syn match muttrcColorNLH contained skipnl "\s*\\$" nextgroup=muttrcColorContextH,muttrcColorNLH +syn match muttrcColorKeywordH contained skipwhite /\/ nextgroup=muttrcColorContextH,muttrcColorNLH +syn region muttrcColorLine keepend skipwhite start=/\/ skip=+\\$+ end=+$+ contains=muttrcColorKeywordH,muttrcComment,muttrcUnHighlightSpace +" And now color's brother: +syn region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syn region muttrcUnColorPatterns contained skipwhite start=+\s*"+ end=+"+ skip=+\\"+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syn match muttrcUnColorPatterns contained skipwhite /\s*[^'"\s]\S\*/ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syn match muttrcUnColorPatNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syn match muttrcUnColorAll contained skipwhite /[*]/ +syn match muttrcUnColorAPNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL +syn match muttrcUnColorIndex contained skipwhite /\s*index\s\+/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL +syn match muttrcUnColorIndexNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL +syn match muttrcUnColorKeyword contained skipwhite /^\s*uncolor\s\+/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL +syn region muttrcUnColorLine keepend start=+^\s*uncolor\s+ skip=+\\$+ end=+$+ contains=muttrcUnColorKeyword,muttrcComment,muttrcUnHighlightSpace + +" Mono are almost like color (ojects inherited from color) +syn keyword muttrcMonoAttrib contained bold none normal reverse standout underline +syn keyword muttrcMono contained mono skipwhite nextgroup=muttrcColorField +syn match muttrcMonoLine "^\s*mono\s\+\S\+" skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +hi def link muttrcComment Comment +hi def link muttrcEscape SpecialChar +hi def link muttrcRXChars SpecialChar +hi def link muttrcString String +hi def link muttrcRXString String +hi def link muttrcRXString2 String +hi def link muttrcSpecial Special +hi def link muttrcHooks Type +hi def link muttrcGroupFlag Type +hi def link muttrcGroupDef Macro +hi def link muttrcAddrDef muttrcGroupFlag +hi def link muttrcRXDef muttrcGroupFlag +hi def link muttrcRXPat String +hi def link muttrcAliasGroupName Macro +hi def link muttrcAliasKey Identifier +hi def link muttrcUnAliasKey Identifier +hi def link muttrcAliasEncEmail Identifier +hi def link muttrcAliasParens Type +hi def link muttrcSetNumAssignment Number +hi def link muttrcSetBoolAssignment Boolean +hi def link muttrcSetQuadAssignment Boolean +hi def link muttrcSetStrAssignment String +hi def link muttrcEmail Special +hi def link muttrcVariableInner Special +hi def link muttrcEscapedVariable String +hi def link muttrcHeader Type +hi def link muttrcKeySpecial SpecialChar +hi def link muttrcKey Type +hi def link muttrcKeyName SpecialChar +hi def link muttrcVarBool Identifier +hi def link muttrcVarQuad Identifier +hi def link muttrcVarNum Identifier +hi def link muttrcVarStr Identifier +hi def link muttrcMenu Identifier +hi def link muttrcCommand Keyword +hi def link muttrcMacroDescr String +hi def link muttrcAction Macro +hi def link muttrcBadAction Error +hi def link muttrcBindFunction Error +hi def link muttrcBindMenuList Error +hi def link muttrcFunction Macro +hi def link muttrcGroupKeyword muttrcCommand +hi def link muttrcGroupLine Error +hi def link muttrcSubscribeKeyword muttrcCommand +hi def link muttrcSubscribeLine Error +hi def link muttrcListsKeyword muttrcCommand +hi def link muttrcListsLine Error +hi def link muttrcAlternateKeyword muttrcCommand +hi def link muttrcAlternatesLine Error +hi def link muttrcAttachmentsLine muttrcCommand +hi def link muttrcAttachmentsFlag Type +hi def link muttrcAttachmentsMimeType String +hi def link muttrcColorLine Error +hi def link muttrcColorContext Error +hi def link muttrcColorContextI Identifier +hi def link muttrcColorContextH Identifier +hi def link muttrcColorKeyword muttrcCommand +hi def link muttrcColorKeywordI muttrcColorKeyword +hi def link muttrcColorKeywordH muttrcColorKeyword +hi def link muttrcColorField Identifier +hi def link muttrcColor Type +hi def link muttrcColorFG Error +hi def link muttrcColorFGI Error +hi def link muttrcColorFGH Error +hi def link muttrcColorBG Error +hi def link muttrcColorBGI Error +hi def link muttrcColorBGH Error +hi def link muttrcMonoAttrib muttrcColor +hi def link muttrcMono muttrcCommand +hi def link muttrcSimplePat Identifier +hi def link muttrcSimplePatString Macro +hi def link muttrcSimplePatMetas Special +hi def link muttrcPattern Error +hi def link muttrcUnColorLine Error +hi def link muttrcUnColorKeyword muttrcCommand +hi def link muttrcUnColorIndex Identifier +hi def link muttrcShellString muttrcEscape +hi def link muttrcRXHooks muttrcCommand +hi def link muttrcRXHookNot Type +hi def link muttrcPatHooks muttrcCommand +hi def link muttrcPatHookNot Type +hi def link muttrcFormatConditionals2 Type +hi def link muttrcIndexFormatStr muttrcString +hi def link muttrcIndexFormatEscapes muttrcEscape +hi def link muttrcIndexFormatConditionals muttrcFormatConditionals2 +hi def link muttrcAliasFormatStr muttrcString +hi def link muttrcAliasFormatEscapes muttrcEscape +hi def link muttrcAttachFormatStr muttrcString +hi def link muttrcAttachFormatEscapes muttrcEscape +hi def link muttrcAttachFormatConditionals muttrcFormatConditionals2 +hi def link muttrcComposeFormatStr muttrcString +hi def link muttrcComposeFormatEscapes muttrcEscape +hi def link muttrcFolderFormatStr muttrcString +hi def link muttrcFolderFormatEscapes muttrcEscape +hi def link muttrcFolderFormatConditionals muttrcFormatConditionals2 +hi def link muttrcMixFormatStr muttrcString +hi def link muttrcMixFormatEscapes muttrcEscape +hi def link muttrcMixFormatConditionals muttrcFormatConditionals2 +hi def link muttrcPGPFormatStr muttrcString +hi def link muttrcPGPFormatEscapes muttrcEscape +hi def link muttrcPGPFormatConditionals muttrcFormatConditionals2 +hi def link muttrcPGPCmdFormatStr muttrcString +hi def link muttrcPGPCmdFormatEscapes muttrcEscape +hi def link muttrcPGPCmdFormatConditionals muttrcFormatConditionals2 +hi def link muttrcStatusFormatStr muttrcString +hi def link muttrcStatusFormatEscapes muttrcEscape +hi def link muttrcStatusFormatConditionals muttrcFormatConditionals2 +hi def link muttrcPGPGetKeysFormatStr muttrcString +hi def link muttrcPGPGetKeysFormatEscapes muttrcEscape +hi def link muttrcSmimeFormatStr muttrcString +hi def link muttrcSmimeFormatEscapes muttrcEscape +hi def link muttrcSmimeFormatConditionals muttrcFormatConditionals2 +hi def link muttrcTimeEscapes muttrcEscape +hi def link muttrcPGPTimeEscapes muttrcEscape +hi def link muttrcStrftimeEscapes Type +hi def link muttrcStrftimeFormatStr muttrcString +hi def link muttrcFormatErrors Error + +hi def link muttrcBindFunctionNL SpecialChar +hi def link muttrcBindKeyNL SpecialChar +hi def link muttrcBindMenuListNL SpecialChar +hi def link muttrcMacroDescrNL SpecialChar +hi def link muttrcMacroBodyNL SpecialChar +hi def link muttrcMacroKeyNL SpecialChar +hi def link muttrcMacroMenuListNL SpecialChar +hi def link muttrcColorMatchCountNL SpecialChar +hi def link muttrcColorNL SpecialChar +hi def link muttrcColorRXNL SpecialChar +hi def link muttrcColorBGNL SpecialChar +hi def link muttrcColorFGNL SpecialChar +hi def link muttrcAliasNameNL SpecialChar +hi def link muttrcAliasENNL SpecialChar +hi def link muttrcAliasNL SpecialChar +hi def link muttrcUnAliasNL SpecialChar +hi def link muttrcAliasGroupDefNL SpecialChar +hi def link muttrcAliasEncEmailNL SpecialChar +hi def link muttrcPatternNL SpecialChar +hi def link muttrcUnColorPatNL SpecialChar +hi def link muttrcUnColorAPNL SpecialChar +hi def link muttrcUnColorIndexNL SpecialChar +hi def link muttrcStringNL SpecialChar + + +let b:current_syntax = "muttrc" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" Vim syntax file for the NeoMutt attach-headers-color feature. + +syntax keyword muttrcColorField contained attach_headers + +" Vim syntax file for the NeoMutt compress feature. + +syntax keyword muttrcCommand append-hook +syntax keyword muttrcCommand close-hook +syntax keyword muttrcCommand open-hook + +" Vim syntax file for the NeoMutt encrypt-to-self feature. + +syntax keyword muttrcVarQuad contained skipwhite smime_encrypt_self nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarQuad contained skipwhite pgp_encrypt_self nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" Vim syntax file for the NeoMutt forgotten-attachment feature. + +syntax keyword muttrcVarBool skipwhite contained abort_noattach nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarStr contained skipwhite attach_keyword nextgroup=muttrcVarEqualsIdxFmt + +" Vim syntax file for the NeoMutt ifdef feature. + +syntax keyword muttrcCommand ifdef +syntax keyword muttrcCommand ifndef +syntax keyword muttrcCommand finish + +" Vim syntax file for the NeoMutt index-color feature. + +syntax keyword muttrcColorField contained index +syntax keyword muttrcColorField contained index_author +syntax keyword muttrcColorField contained index_collapsed +syntax keyword muttrcColorField contained index_date +syntax keyword muttrcColorField contained index_flags +syntax keyword muttrcColorField contained index_label +syntax keyword muttrcColorField contained index_number +syntax keyword muttrcColorField contained index_size +syntax keyword muttrcColorField contained index_subject +syn region muttrcColorLine keepend start=/^\s*color\s\+index_\%(author\|collapsed\|date\|flags\|label\|number\|size\|subject\)/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace +" Vim syntax file for the NeoMutt keywords feature. + +syntax keyword muttrcVarBool contained skipwhite keywords_legacy nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite keywords_standard nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarStr contained skipwhite xlabel_delimiter nextgroup=muttrcVarEqualsIdxFmt + +syntax match muttrcFunction contained "\" + +" Vim syntax file for the NeoMutt new-mail feature. + +syntax keyword muttrcVarStr contained skipwhite new_mail_command nextgroup=muttrcVarEqualsIdxFmt + +" Vim syntax file for the NeoMutt nntp feature. + +syntax keyword muttrcVarBool contained skipwhite ask_follow_up nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite ask_x_comment_to nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite mime_subject nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite nntp_listgroup nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite nntp_load_description nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite save_unsubscribed nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite show_new_news nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite show_only_unread nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite x_comment_to nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarNum contained skipwhite nntp_context nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarNum contained skipwhite nntp_poll nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarQuad contained skipwhite catchup_newsgroup nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarQuad contained skipwhite followup_to_poster nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarQuad contained skipwhite post_moderated nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarStr contained skipwhite group_index_format nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite inews nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite newsgroups_charset nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite newsrc nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite news_cache_dir nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite news_server nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nntp_authenticators nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nntp_pass nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nntp_user nextgroup=muttrcVarEqualsIdxFmt + +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" + +" Vim syntax file for the NeoMutt notmuch feature. + +syntax keyword muttrcVarBool contained skipwhite nm_record nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite virtual_spoolfile nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarNum contained skipwhite nm_db_limit nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarNum contained skipwhite nm_open_timeout nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarNum contained skipwhite nm_query_window_duration nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarNum contained skipwhite nm_query_window_timebase nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarStr contained skipwhite nm_default_uri nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nm_exclude_tags nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nm_hidden_tags nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nm_query_type nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nm_record_tags nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite nm_unread_tag nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite vfolder_format nextgroup=muttrcVarEqualsIdxFmt + +syntax keyword muttrcCommand virtual-mailboxes +syntax keyword muttrcCommand tag-transforms +syntax keyword muttrcCommand tag-formats + +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" + +" Vim syntax file for the NeoMutt progress feature. + +syntax keyword muttrcColorField contained progress + +" Vim syntax file for the NeoMutt quasi-delete feature. + +syntax match muttrcFunction contained "\" + +" Vim syntax file for the NeoMutt reply-with-xorig feature. + +syntax keyword muttrcVarBool skipwhite contained reply_with_xorig nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" Vim syntax file for the NeoMutt sidebar feature. + +syntax keyword muttrcVarBool contained skipwhite sidebar_folder_indent nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite sidebar_new_mail_only nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite sidebar_next_new_wrap nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite sidebar_short_path nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarBool contained skipwhite sidebar_visible nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarNum contained skipwhite sidebar_width nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarStr contained skipwhite sidebar_divider_char nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite sidebar_delim_chars nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite sidebar_format nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite sidebar_indent_string nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite sidebar_sort_method nextgroup=muttrcVarEqualsIdxFmt + +syntax keyword muttrcCommand sidebar_whitelist + +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" +syntax match muttrcFunction contained "\" + +syntax keyword muttrcColorField contained sidebar_divider +syntax keyword muttrcColorField contained sidebar_flagged +syntax keyword muttrcColorField contained sidebar_highlight +syntax keyword muttrcColorField contained sidebar_indicator +syntax keyword muttrcColorField contained sidebar_new + +" Vim syntax file for the NeoMutt timeout feature. + +syntax keyword muttrcCommand timeout-hook + +" Vim syntax file for the NeoMutt miscellany (options without features). + +syntax keyword muttrcVarBool contained skipwhite collapse_all nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +syntax keyword muttrcVarStr contained skipwhite header_cache_backend nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +"EOF vim: ts=8 noet tw=100 sw=8 sts=0 ft=vim diff --git a/syntax/tex.vim b/syntax/tex.vim new file mode 100644 index 0000000..6d12226 --- /dev/null +++ b/syntax/tex.vim @@ -0,0 +1,1326 @@ +" Vim syntax file +" Language: TeX +" Maintainer: Charles E. Campbell +" Last Change: Nov 14, 2012 +" Version: 75 +" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax +" +" Notes: {{{1 +" +" 1. If you have a \begin{verbatim} that appears to overrun its boundaries, +" use %stopzone. +" +" 2. Run-on equations ($..$ and $$..$$, particularly) can also be stopped +" by suitable use of %stopzone. +" +" 3. If you have a slow computer, you may wish to modify +" +" syn sync maxlines=200 +" syn sync minlines=50 +" +" to values that are more to your liking. +" +" 4. There is no match-syncing for $...$ and $$...$$; hence large +" equation blocks constructed that way may exhibit syncing problems. +" (there's no difference between begin/end patterns) +" +" 5. If you have the variable "g:tex_no_error" defined then none of the +" lexical error-checking will be done. +" +" ie. let g:tex_no_error=1 + +" Version Clears: {{{1 +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif +let s:keepcpo= &cpo +set cpo&vim +scriptencoding utf-8 + +" Define the default highlighting. {{{1 +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_tex_syntax_inits") + let did_tex_syntax_inits = 1 + if version < 508 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif +endif +if exists("g:tex_tex") && !exists("g:tex_no_error") + let g:tex_no_error= 1 +endif + +" let user determine which classes of concealment will be supported +" a=accents/ligatures d=delimiters m=math symbols g=Greek s=superscripts/subscripts +if !exists("g:tex_conceal") + let s:tex_conceal= 'abdmgs' +else + let s:tex_conceal= g:tex_conceal +endif + +" Determine whether or not to use "*.sty" mode {{{1 +" The user may override the normal determination by setting +" g:tex_stylish to 1 (for "*.sty" mode) +" or to 0 else (normal "*.tex" mode) +" or on a buffer-by-buffer basis with b:tex_stylish +let s:extfname=expand("%:e") +if exists("g:tex_stylish") + let b:tex_stylish= g:tex_stylish +elseif !exists("b:tex_stylish") + if s:extfname == "sty" || s:extfname == "cls" || s:extfname == "clo" || s:extfname == "dtx" || s:extfname == "ltx" + let b:tex_stylish= 1 + else + let b:tex_stylish= 0 + endif +endif + +" handle folding {{{1 +if !exists("g:tex_fold_enabled") + let g:tex_fold_enabled= 0 +elseif g:tex_fold_enabled && !has("folding") + let g:tex_fold_enabled= 0 + echomsg "Ignoring g:tex_fold_enabled=".g:tex_fold_enabled."; need to re-compile vim for +fold support" +endif +if g:tex_fold_enabled && &fdm == "manual" + setl fdm=syntax +endif + +" (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1 +" but _ is the only one that causes problems. +" One may override this iskeyword setting by providing +" g:tex_isk +if exists("g:tex_isk") + exe "setlocal isk=".g:tex_isk +else + setlocal isk=48-57,a-z,A-Z,192-255 +endif +if b:tex_stylish + setlocal isk+=@-@ +endif +if exists("g:tex_nospell") && g:tex_nospell && !exists("g:tex_comment_nospell") + let g:tex_comment_nospell= 1 +endif + +" Clusters: {{{1 +" -------- +syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle +if !exists("g:tex_no_error") + syn cluster texCmdGroup add=texMathError +endif +syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement +syn cluster texFoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texItalStyle,texNoSpell +syn cluster texBoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texBoldItalStyle,texNoSpell +syn cluster texItalGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texItalStyle,texItalBoldStyle,texNoSpell +if !exists("g:tex_nospell") || !g:tex_nospell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell + syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher +else + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption + syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher +endif +syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption +syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter +if !exists("tex_no_math") + syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ + syn cluster texMatchGroup add=@texMathZones + syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2 + syn cluster texMathMatchGroup contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone + syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texMathSymbol,texMathText,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle + if !exists("g:tex_no_error") + syn cluster texMathMatchGroup add=texMathError + syn cluster texMathZoneGroup add=texMathError + endif + syn cluster texMathZoneGroup add=@NoSpell + " following used in the \part \chapter \section \subsection \subsubsection + " \paragraph \subparagraph \author \title highlighting + syn cluster texDocGroup contains=texPartZone,@texPartGroup + syn cluster texPartGroup contains=texChapterZone,texSectionZone,texParaZone + syn cluster texChapterGroup contains=texSectionZone,texParaZone + syn cluster texSectionGroup contains=texSubSectionZone,texParaZone + syn cluster texSubSectionGroup contains=texSubSubSectionZone,texParaZone + syn cluster texSubSubSectionGroup contains=texParaZone + syn cluster texParaGroup contains=texSubParaZone + if has("conceal") && &enc == 'utf-8' + syn cluster texMathZoneGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol + syn cluster texMathMatchGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol + endif +endif + +" Try to flag {} and () mismatches: {{{1 +if !exists("g:tex_no_error") + syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup,texError + syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError,@NoSpell +else + syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup + syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup +endif +if !exists("g:tex_nospell") || !g:tex_nospell + syn region texParen start="(" end=")" contains=@texMatchGroup,@Spell +else + syn region texParen start="(" end=")" contains=@texMatchGroup +endif +if !exists("g:tex_no_error") + syn match texError "[}\])]" +endif +if !exists("tex_no_math") + if !exists("g:tex_no_error") + syn match texMathError "}" contained + endif + syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup +endif + +" TeX/LaTeX keywords: {{{1 +" Instead of trying to be All Knowing, I just match \..alphameric.. +" Note that *.tex files may not have "@" in their \commands +if exists("g:tex_tex") || b:tex_stylish + syn match texStatement "\\[a-zA-Z@]\+" +else + syn match texStatement "\\\a\+" + if !exists("g:tex_no_error") + syn match texError "\\\a*@[a-zA-Z@]*" + endif +endif + +" TeX/LaTeX delimiters: {{{1 +syn match texDelimiter "&" +syn match texDelimiter "\\\\" +syn match texDelimiter "[{}]" + +" Tex/Latex Options: {{{1 +syn match texOption "[^\\]\zs#\d\+\|^#\d\+" + +" texAccent (tnx to Karim Belabas) avoids annoying highlighting for accents: {{{1 +if b:tex_stylish + syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 + syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 +else + syn match texAccent "\\[bcdvuH]\A"me=e-1 + syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)\A"me=e-1 +endif +syn match texAccent "\\[bcdvuH]$" +syn match texAccent +\\[=^.\~"`']+ +syn match texAccent +\\['=t'.c^ud"vb~Hr]{\a}+ +syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$" + +" \begin{}/\end{} section markers: {{{1 +syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName +syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment +syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell + +" \documentclass, \documentstyle, \usepackage: {{{1 +syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texBeginEndName,texDocTypeArgs +syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texBeginEndName contains=texComment,@NoSpell + +" Preamble syntax-based folding support: {{{1 +if g:tex_fold_enabled && has("folding") + syn region texPreamble transparent fold start='\zs\\documentclass\>' end='\ze\\begin{document}' contains=texStyle,@texPreambleMatchGroup +endif + +" TeX input: {{{1 +syn match texInput "\\input\s\+[a-zA-Z/.0-9_^]\+"hs=s+7 contains=texStatement +syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt +syn match texInputFile "\\subfile\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt +syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt +syn match texInputCurlies "[{}]" contained +syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained contains=texComment + +" Type Styles (LaTeX 2.09): {{{1 +syn match texTypeStyle "\\rm\>" +syn match texTypeStyle "\\em\>" +syn match texTypeStyle "\\bf\>" +syn match texTypeStyle "\\it\>" +syn match texTypeStyle "\\sl\>" +syn match texTypeStyle "\\sf\>" +syn match texTypeStyle "\\sc\>" +syn match texTypeStyle "\\tt\>" + +" Type Styles: attributes, commands, families, etc (LaTeX2E): {{{1 +if s:tex_conceal !~ 'b' + syn match texTypeStyle "\\textbf\>" + syn match texTypeStyle "\\textit\>" +endif +syn match texTypeStyle "\\textmd\>" +syn match texTypeStyle "\\textrm\>" +syn match texTypeStyle "\\textsc\>" +syn match texTypeStyle "\\textsf\>" +syn match texTypeStyle "\\textsl\>" +syn match texTypeStyle "\\texttt\>" +syn match texTypeStyle "\\textup\>" +syn match texTypeStyle "\\emph\>" + +syn match texTypeStyle "\\mathbb\>" +syn match texTypeStyle "\\mathbf\>" +syn match texTypeStyle "\\mathcal\>" +syn match texTypeStyle "\\mathfrak\>" +syn match texTypeStyle "\\mathit\>" +syn match texTypeStyle "\\mathnormal\>" +syn match texTypeStyle "\\mathrm\>" +syn match texTypeStyle "\\mathsf\>" +syn match texTypeStyle "\\mathtt\>" + +syn match texTypeStyle "\\rmfamily\>" +syn match texTypeStyle "\\sffamily\>" +syn match texTypeStyle "\\ttfamily\>" + +syn match texTypeStyle "\\itshape\>" +syn match texTypeStyle "\\scshape\>" +syn match texTypeStyle "\\slshape\>" +syn match texTypeStyle "\\upshape\>" + +syn match texTypeStyle "\\bfseries\>" +syn match texTypeStyle "\\mdseries\>" + +" Some type sizes: {{{1 +syn match texTypeSize "\\tiny\>" +syn match texTypeSize "\\scriptsize\>" +syn match texTypeSize "\\footnotesize\>" +syn match texTypeSize "\\small\>" +syn match texTypeSize "\\normalsize\>" +syn match texTypeSize "\\large\>" +syn match texTypeSize "\\Large\>" +syn match texTypeSize "\\LARGE\>" +syn match texTypeSize "\\huge\>" +syn match texTypeSize "\\Huge\>" + +" Spacecodes (TeX'isms): {{{1 +" \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x +syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=texSpaceCodeChar +syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained + +" Sections, subsections, etc: {{{1 +if !exists("g:tex_nospell") || !g:tex_nospell + if g:tex_fold_enabled && has("folding") + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell + syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell + syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell + syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell + syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell + syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell + syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell + syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell + syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell + else + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell + syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell + syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell + syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell + syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell + syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell + syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell + syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell + syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell + endif +else + if g:tex_fold_enabled && has("folding") + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup + syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup + syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup + syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup + syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup + syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup + syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup + syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup + syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup + else + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup + syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup + syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup + syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup + syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup + syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup + syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup + syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup + syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup + endif +endif + +" particular support for bold and italic {{{1 +if s:tex_conceal =~ 'b' + syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" end="}" concealends contains=@texBoldGroup + syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" end="}" concealends contains=@texItalGroup + syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" end="}" concealends contains=@texItalGroup + syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" end="}" concealends contains=@texBoldGroup +endif + +" Bad Math (mismatched): {{{1 +if !exists("tex_no_math") + syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}" + syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}" + syn match texBadMath "\\[\])]" +endif + +" Math Zones: {{{1 +if !exists("tex_no_math") + " TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2 + " Starred forms are created if starform is true. Starred + " forms have syntax group and synchronization groups with a + " "S" appended. Handles: cluster, syntax, sync, and HiLink. + fun! TexNewMathZone(sfx,mathzone,starform) + let grpname = "texMathZone".a:sfx + let syncname = "texSyncMathZone".a:sfx + if g:tex_fold_enabled + let foldcmd= " fold" + else + let foldcmd= "" + endif + exe "syn cluster texMathZones add=".grpname + exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd + exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' + exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' + exe 'hi def link '.grpname.' texMath' + if a:starform + let grpname = "texMathZone".a:sfx.'S' + let syncname = "texSyncMathZone".a:sfx.'S' + exe "syn cluster texMathZones add=".grpname + exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\*\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\*\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd + exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' + exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' + exe 'hi def link '.grpname.' texMath' + endif + endfun + + " Standard Math Zones: {{{2 + call TexNewMathZone("A","align",1) + call TexNewMathZone("B","alignat",1) + call TexNewMathZone("C","displaymath",1) + call TexNewMathZone("D","eqnarray",1) + call TexNewMathZone("E","equation",1) + call TexNewMathZone("F","flalign",1) + call TexNewMathZone("G","gather",1) + call TexNewMathZone("H","math",1) + call TexNewMathZone("I","multline",1) + call TexNewMathZone("J","subequations",0) + call TexNewMathZone("K","xalignat",1) + call TexNewMathZone("L","xxalignat",0) + + " Inline Math Zones: {{{2 + if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~ 'd' + syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup + syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup + syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup + syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" concealends keepend contains=@texMathZoneGroup + else + syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup + syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup + endif + syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup + + syn match texMathOper "[_^=]" contained + + " Text Inside Math Zones: {{{2 + if !exists("g:tex_nospell") || !g:tex_nospell + syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup,@Spell + else + syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup + endif + + " \left..something.. and \right..something.. support: {{{2 + syn match texMathDelimBad contained "\S" + if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~ 'm' + syn match texMathDelim contained "\\left\\{\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ + syn match texMathDelim contained "\\right\\}\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} + let s:texMathDelimList=[ + \ ['<' , '<'] , + \ ['>' , '>'] , + \ ['(' , '('] , + \ [')' , ')'] , + \ ['\[' , '['] , + \ [']' , ']'] , + \ ['\\{' , '{'] , + \ ['\\}' , '}'] , + \ ['|' , '|'] , + \ ['\\|' , '‖'] , + \ ['\\backslash' , '\'] , + \ ['\\downarrow' , '↓'] , + \ ['\\Downarrow' , '⇓'] , + \ ['\\langle' , '<'] , + \ ['\\lbrace' , '['] , + \ ['\\lceil' , '⌈'] , + \ ['\\lfloor' , '⌊'] , + \ ['\\lgroup' , '⌊'] , + \ ['\\lmoustache' , '⎛'] , + \ ['\\rangle' , '>'] , + \ ['\\rbrace' , ']'] , + \ ['\\rceil' , '⌉'] , + \ ['\\rfloor' , '⌋'] , + \ ['\\rgroup' , '⌋'] , + \ ['\\rmoustache' , '⎞'] , + \ ['\\uparrow' , '↑'] , + \ ['\\Uparrow' , '↑'] , + \ ['\\updownarrow', '↕'] , + \ ['\\Updownarrow', '⇕']] + syn match texMathDelim '\\[bB]igg\=[lr]' contained nextgroup=texMathDelimBad + for texmath in s:texMathDelimList + exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=".texmath[0]."' contained conceal cchar=".texmath[1] + endfor + + else + syn match texMathDelim contained "\\\(left\|right\)\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad + syn match texMathDelim contained "\\[bB]igg\=[lr]\=\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad + syn match texMathDelimSet2 contained "\\" nextgroup=texMathDelimKey,texMathDelimBad + syn match texMathDelimSet1 contained "[<>()[\]|/.]\|\\[{}|]" + syn keyword texMathDelimKey contained backslash lceil lVert rgroup uparrow + syn keyword texMathDelimKey contained downarrow lfloor rangle rmoustache Uparrow + syn keyword texMathDelimKey contained Downarrow lgroup rbrace rvert updownarrow + syn keyword texMathDelimKey contained langle lmoustache rceil rVert Updownarrow + syn keyword texMathDelimKey contained lbrace lvert rfloor + endif + syn match texMathDelim contained "\\\(left\|right\)arrow\>\|\<\([aA]rrow\|brace\)\=vert\>" + syn match texMathDelim contained "\\lefteqn\>" +endif + +" Special TeX characters ( \$ \& \% \# \{ \} \_ \S \P ) : {{{1 +syn match texSpecialChar "\\[$&%#{}_]" +if b:tex_stylish + syn match texSpecialChar "\\[SP@][^a-zA-Z@]"me=e-1 +else + syn match texSpecialChar "\\[SP@]\A"me=e-1 +endif +syn match texSpecialChar "\\\\" +if !exists("tex_no_math") + syn match texOnlyMath "[_^]" +endif +syn match texSpecialChar "\^\^[0-9a-f]\{2}\|\^\^\S" + +" Comments: {{{1 +" Normal TeX LaTeX : %.... +" Documented TeX Format: ^^A... -and- leading %s (only) +if !exists("g:tex_comment_nospell") || !g:tex_comment_nospell + syn cluster texCommentGroup contains=texTodo,@Spell +else + syn cluster texCommentGroup contains=texTodo,@NoSpell +endif +syn case ignore +syn keyword texTodo contained combak fixme todo xxx +syn case match +if s:extfname == "dtx" + syn match texComment "\^\^A.*$" contains=@texCommentGroup + syn match texComment "^%\+" contains=@texCommentGroup +else + if g:tex_fold_enabled + " allows syntax-folding of 2 or more contiguous comment lines + " single-line comments are not folded + syn match texComment "%.*$" contains=@texCommentGroup + syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' fold + syn region texNoSpell contained fold matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell + else + syn match texComment "%.*$" contains=@texCommentGroup + syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell + endif +endif + +" Separate lines used for verb` and verb# so that the end conditions {{{1 +" will appropriately terminate. +" If g:tex_verbspell exists, then verbatim texZones will permit spellchecking there. +if exists("g:tex_verbspell") && g:tex_verbspell + syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell + " listings package: + syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" contains=@Spell + if version < 600 + syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" contains=@Spell + syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" contains=@Spell + else + if b:tex_stylish + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell + else + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" contains=@Spell + endif + endif +else + syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" + if version < 600 + syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" + syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" + else + if b:tex_stylish + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" + else + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" + endif + endif +endif + +syn region texZone matchgroup=texStatement start="\\code{" end="}\|%stopzone\>" + +" Tex Reference Zones: {{{1 +syn region texZone matchgroup=texStatement start="@samp{" end="}\|%stopzone\>" contains=@texRefGroup +syn region texRefZone matchgroup=texStatement start="\\nocite{" end="}\|%stopzone\>" contains=@texRefGroup +syn region texRefZone matchgroup=texStatement start="\\bibliography{" end="}\|%stopzone\>" contains=@texRefGroup +syn region texRefZone matchgroup=texStatement start="\\label{" end="}\|%stopzone\>" contains=@texRefGroup +syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup +syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup +"syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite +syn match texRefZone '\\[a-z]*cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite +syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite +syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite + +" Handle newcommand, newenvironment : {{{1 +syn match texNewCmd "\\newcommand\>" nextgroup=texCmdName skipwhite skipnl +syn region texCmdName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texCmdArgs,texCmdBody skipwhite skipnl +syn region texCmdArgs contained matchgroup=Delimiter start="\["rs=s+1 end="]" nextgroup=texCmdBody skipwhite skipnl +syn region texCmdBody contained matchgroup=Delimiter start="{"rs=s+1 skip="\\\\\|\\[{}]" matchgroup=Delimiter end="}" contains=@texCmdGroup +syn match texNewEnv "\\newenvironment\>" nextgroup=texEnvName skipwhite skipnl +syn region texEnvName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvBgn skipwhite skipnl +syn region texEnvBgn contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvEnd skipwhite skipnl contains=@texEnvGroup +syn region texEnvEnd contained matchgroup=Delimiter start="{"rs=s+1 end="}" skipwhite skipnl contains=@texEnvGroup + +" Definitions/Commands: {{{1 +syn match texDefCmd "\\def\>" nextgroup=texDefName skipwhite skipnl +if b:tex_stylish + syn match texDefName contained "\\[a-zA-Z@]\+" nextgroup=texDefParms,texCmdBody skipwhite skipnl + syn match texDefName contained "\\[^a-zA-Z@]" nextgroup=texDefParms,texCmdBody skipwhite skipnl +else + syn match texDefName contained "\\\a\+" nextgroup=texDefParms,texCmdBody skipwhite skipnl + syn match texDefName contained "\\\A" nextgroup=texDefParms,texCmdBody skipwhite skipnl +endif +syn match texDefParms contained "#[^{]*" contains=texDefParm nextgroup=texCmdBody skipwhite skipnl +syn match texDefParm contained "#\d\+" + +" TeX Lengths: {{{1 +syn match texLength "\<\d\+\([.,]\d\+\)\=\s*\(true\)\=\s*\(bp\|cc\|cm\|dd\|em\|ex\|in\|mm\|pc\|pt\|sp\)\>" + +" TeX String Delimiters: {{{1 +syn match texString "\(``\|''\|,,\)" + +" makeatletter -- makeatother sections +if !exists("g:tex_no_error") + syn region texStyle matchgroup=texStatement start='\\makeatletter' end='\\makeatother' contains=@texStyleGroup contained + syn match texStyleStatement "\\[a-zA-Z@]\+" contained + syn region texStyleMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texStyleGroup,texError contained + syn region texStyleMatcher matchgroup=Delimiter start="\[" end="]" contains=@texStyleGroup,texError contained +endif + +" Conceal mode support (supports set cole=2) {{{1 +if has("conceal") && &enc == 'utf-8' + + " Math Symbols {{{2 + " (many of these symbols were contributed by Björn Winckler) + if s:tex_conceal =~ 'm' + let s:texMathList=[ + \ ['|' , '‖'], + \ ['aleph' , 'ℵ'], + \ ['amalg' , '∐'], + \ ['angle' , '∠'], + \ ['approx' , '≈'], + \ ['ast' , '∗'], + \ ['asymp' , '≍'], + \ ['backepsilon' , '∍'], + \ ['backsimeq' , '≃'], + \ ['backslash' , '∖'], + \ ['barwedge' , '⊼'], + \ ['because' , '∵'], + \ ['between' , '≬'], + \ ['bigcap' , '∩'], + \ ['bigcirc' , '○'], + \ ['bigcup' , '∪'], + \ ['bigodot' , '⊙'], + \ ['bigoplus' , '⊕'], + \ ['bigotimes' , '⊗'], + \ ['bigsqcup' , '⊔'], + \ ['bigtriangledown', '∇'], + \ ['bigtriangleup' , '∆'], + \ ['bigvee' , '⋁'], + \ ['bigwedge' , '⋀'], + \ ['blacksquare' , '∎'], + \ ['bot' , '⊥'], + \ ['bowtie' , '⋈'], + \ ['boxdot' , '⊡'], + \ ['boxminus' , '⊟'], + \ ['boxplus' , '⊞'], + \ ['boxtimes' , '⊠'], + \ ['bullet' , '•'], + \ ['bumpeq' , '≏'], + \ ['Bumpeq' , '≎'], + \ ['cap' , '∩'], + \ ['Cap' , '⋒'], + \ ['cdot' , '·'], + \ ['cdots' , '⋯'], + \ ['circ' , '∘'], + \ ['circeq' , '≗'], + \ ['circlearrowleft', '↺'], + \ ['circlearrowright', '↻'], + \ ['circledast' , '⊛'], + \ ['circledcirc' , '⊚'], + \ ['clubsuit' , '♣'], + \ ['complement' , '∁'], + \ ['cong' , '≅'], + \ ['coprod' , '∐'], + \ ['copyright' , '©'], + \ ['cup' , '∪'], + \ ['Cup' , '⋓'], + \ ['curlyeqprec' , '⋞'], + \ ['curlyeqsucc' , '⋟'], + \ ['curlyvee' , '⋎'], + \ ['curlywedge' , '⋏'], + \ ['dagger' , '†'], + \ ['dashv' , '⊣'], + \ ['ddagger' , '‡'], + \ ['ddots' , '⋱'], + \ ['diamond' , '⋄'], + \ ['diamondsuit' , '♢'], + \ ['div' , '÷'], + \ ['doteq' , '≐'], + \ ['doteqdot' , '≑'], + \ ['dotplus' , '∔'], + \ ['dots' , '…'], + \ ['dotsb' , '⋯'], + \ ['dotsc' , '…'], + \ ['dotsi' , '⋯'], + \ ['dotso' , '…'], + \ ['doublebarwedge' , '⩞'], + \ ['downarrow' , '↓'], + \ ['Downarrow' , '⇓'], + \ ['ell' , 'ℓ'], + \ ['emptyset' , '∅'], + \ ['eqcirc' , '≖'], + \ ['eqsim' , '≂'], + \ ['eqslantgtr' , '⪖'], + \ ['eqslantless' , '⪕'], + \ ['equiv' , '≡'], + \ ['exists' , '∃'], + \ ['fallingdotseq' , '≒'], + \ ['flat' , '♭'], + \ ['forall' , '∀'], + \ ['frown' , '⁔'], + \ ['ge' , '≥'], + \ ['geq' , '≥'], + \ ['geqq' , '≧'], + \ ['gets' , '←'], + \ ['gg' , '⟫'], + \ ['gneqq' , '≩'], + \ ['gtrdot' , '⋗'], + \ ['gtreqless' , '⋛'], + \ ['gtrless' , '≷'], + \ ['gtrsim' , '≳'], + \ ['hbar' , 'ℏ'], + \ ['heartsuit' , '♡'], + \ ['hookleftarrow' , '↩'], + \ ['hookrightarrow' , '↪'], + \ ['iiint' , '∭'], + \ ['iint' , '∬'], + \ ['Im' , 'ℑ'], + \ ['imath' , 'ɩ'], + \ ['in' , '∈'], + \ ['infty' , '∞'], + \ ['int' , '∫'], + \ ['lceil' , '⌈'], + \ ['ldots' , '…'], + \ ['le' , '≤'], + \ ['leadsto' , '↝'], + \ ['left(' , '('], + \ ['left\[' , '['], + \ ['left\\{' , '{'], + \ ['leftarrow' , '⟵'], + \ ['Leftarrow' , '⟸'], + \ ['leftarrowtail' , '↢'], + \ ['leftharpoondown', '↽'], + \ ['leftharpoonup' , '↼'], + \ ['leftrightarrow' , '↔'], + \ ['Leftrightarrow' , '⇔'], + \ ['leftrightsquigarrow', '↭'], + \ ['leftthreetimes' , '⋋'], + \ ['leq' , '≤'], + \ ['leq' , '≤'], + \ ['leqq' , '≦'], + \ ['lessdot' , '⋖'], + \ ['lesseqgtr' , '⋚'], + \ ['lesssim' , '≲'], + \ ['lfloor' , '⌊'], + \ ['ll' , '≪'], + \ ['lmoustache' , '╭'], + \ ['lneqq' , '≨'], + \ ['ltimes' , '⋉'], + \ ['mapsto' , '↦'], + \ ['measuredangle' , '∡'], + \ ['mid' , '∣'], + \ ['models' , '╞'], + \ ['mp' , '∓'], + \ ['nabla' , '∇'], + \ ['natural' , '♮'], + \ ['ncong' , '≇'], + \ ['ne' , '≠'], + \ ['nearrow' , '↗'], + \ ['neg' , '¬'], + \ ['neq' , '≠'], + \ ['nexists' , '∄'], + \ ['ngeq' , '≱'], + \ ['ngeqq' , '≱'], + \ ['ngtr' , '≯'], + \ ['ni' , '∋'], + \ ['nleftarrow' , '↚'], + \ ['nLeftarrow' , '⇍'], + \ ['nLeftrightarrow', '⇎'], + \ ['nleq' , '≰'], + \ ['nleqq' , '≰'], + \ ['nless' , '≮'], + \ ['nmid' , '∤'], + \ ['notin' , '∉'], + \ ['nprec' , '⊀'], + \ ['nrightarrow' , '↛'], + \ ['nRightarrow' , '⇏'], + \ ['nsim' , '≁'], + \ ['nsucc' , '⊁'], + \ ['ntriangleleft' , '⋪'], + \ ['ntrianglelefteq', '⋬'], + \ ['ntriangleright' , '⋫'], + \ ['ntrianglerighteq', '⋭'], + \ ['nvdash' , '⊬'], + \ ['nvDash' , '⊭'], + \ ['nVdash' , '⊮'], + \ ['nwarrow' , '↖'], + \ ['odot' , '⊙'], + \ ['oint' , '∮'], + \ ['ominus' , '⊖'], + \ ['oplus' , '⊕'], + \ ['oslash' , '⊘'], + \ ['otimes' , '⊗'], + \ ['owns' , '∋'], + \ ['P' , '¶'], + \ ['parallel' , '║'], + \ ['partial' , '∂'], + \ ['perp' , '⊥'], + \ ['pitchfork' , '⋔'], + \ ['pm' , '±'], + \ ['prec' , '≺'], + \ ['precapprox' , '⪷'], + \ ['preccurlyeq' , '≼'], + \ ['preceq' , '⪯'], + \ ['precnapprox' , '⪹'], + \ ['precneqq' , '⪵'], + \ ['precsim' , '≾'], + \ ['prime' , '′'], + \ ['prod' , '∏'], + \ ['propto' , '∝'], + \ ['rceil' , '⌉'], + \ ['Re' , 'ℜ'], + \ ['rfloor' , '⌋'], + \ ['right)' , ')'], + \ ['right]' , ']'], + \ ['right\\}' , '}'], + \ ['rightarrow' , '⟶'], + \ ['Rightarrow' , '⟹'], + \ ['rightarrowtail' , '↣'], + \ ['rightleftharpoons', '⇌'], + \ ['rightsquigarrow', '↝'], + \ ['rightthreetimes', '⋌'], + \ ['risingdotseq' , '≓'], + \ ['rmoustache' , '╮'], + \ ['rtimes' , '⋊'], + \ ['S' , '§'], + \ ['searrow' , '↘'], + \ ['setminus' , '∖'], + \ ['sharp' , '♯'], + \ ['sim' , '∼'], + \ ['simeq' , '⋍'], + \ ['smile' , '‿'], + \ ['spadesuit' , '♠'], + \ ['sphericalangle' , '∢'], + \ ['sqcap' , '⊓'], + \ ['sqcup' , '⊔'], + \ ['sqsubset' , '⊏'], + \ ['sqsubseteq' , '⊑'], + \ ['sqsupset' , '⊐'], + \ ['sqsupseteq' , '⊒'], + \ ['star' , '✫'], + \ ['subset' , '⊂'], + \ ['Subset' , '⋐'], + \ ['subseteq' , '⊆'], + \ ['subseteqq' , '⫅'], + \ ['subsetneq' , '⊊'], + \ ['subsetneqq' , '⫋'], + \ ['succ' , '≻'], + \ ['succapprox' , '⪸'], + \ ['succcurlyeq' , '≽'], + \ ['succeq' , '⪰'], + \ ['succnapprox' , '⪺'], + \ ['succneqq' , '⪶'], + \ ['succsim' , '≿'], + \ ['sum' , '∑'], + \ ['supset' , '⊃'], + \ ['Supset' , '⋑'], + \ ['supseteq' , '⊇'], + \ ['supseteqq' , '⫆'], + \ ['supsetneq' , '⊋'], + \ ['supsetneqq' , '⫌'], + \ ['surd' , '√'], + \ ['swarrow' , '↙'], + \ ['therefore' , '∴'], + \ ['times' , '×'], + \ ['to' , '→'], + \ ['top' , '⊤'], + \ ['triangle' , '∆'], + \ ['triangleleft' , '⊲'], + \ ['trianglelefteq' , '⊴'], + \ ['triangleq' , '≜'], + \ ['triangleright' , '⊳'], + \ ['trianglerighteq', '⊵'], + \ ['twoheadleftarrow', '↞'], + \ ['twoheadrightarrow', '↠'], + \ ['uparrow' , '↑'], + \ ['Uparrow' , '⇑'], + \ ['updownarrow' , '↕'], + \ ['Updownarrow' , '⇕'], + \ ['varnothing' , '∅'], + \ ['vartriangle' , '∆'], + \ ['vdash' , '⊢'], + \ ['vDash' , '⊨'], + \ ['Vdash' , '⊩'], + \ ['vdots' , '⋮'], + \ ['vee' , '∨'], + \ ['veebar' , '⊻'], + \ ['Vvdash' , '⊪'], + \ ['wedge' , '∧'], + \ ['wp' , '℘'], + \ ['wr' , '≀']] +" \ ['jmath' , 'X'] +" \ ['uminus' , 'X'] +" \ ['uplus' , 'X'] + for texmath in s:texMathList + if texmath[0] =~ '\w$' + exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1] + else + exe "syn match texMathSymbol '\\\\".texmath[0]."' contained conceal cchar=".texmath[1] + endif + endfor + + if &ambw == "double" + syn match texMathSymbol '\\gg\>' contained conceal cchar=≫ + syn match texMathSymbol '\\ll\>' contained conceal cchar=≪ + else + syn match texMathSymbol '\\gg\>' contained conceal cchar=⟫ + syn match texMathSymbol '\\ll\>' contained conceal cchar=⟪ + endif + + syn match texMathSymbol '\\hat{a}' contained conceal cchar=â + syn match texMathSymbol '\\hat{A}' contained conceal cchar= + syn match texMathSymbol '\\hat{c}' contained conceal cchar=ĉ + syn match texMathSymbol '\\hat{C}' contained conceal cchar=Ĉ + syn match texMathSymbol '\\hat{e}' contained conceal cchar=ê + syn match texMathSymbol '\\hat{E}' contained conceal cchar=Ê + syn match texMathSymbol '\\hat{g}' contained conceal cchar=ĝ + syn match texMathSymbol '\\hat{G}' contained conceal cchar=Ĝ + syn match texMathSymbol '\\hat{i}' contained conceal cchar=î + syn match texMathSymbol '\\hat{I}' contained conceal cchar=Î + syn match texMathSymbol '\\hat{o}' contained conceal cchar=ô + syn match texMathSymbol '\\hat{O}' contained conceal cchar=Ô + syn match texMathSymbol '\\hat{s}' contained conceal cchar=ŝ + syn match texMathSymbol '\\hat{S}' contained conceal cchar=Ŝ + syn match texMathSymbol '\\hat{u}' contained conceal cchar=û + syn match texMathSymbol '\\hat{U}' contained conceal cchar=Û + syn match texMathSymbol '\\hat{w}' contained conceal cchar=ŵ + syn match texMathSymbol '\\hat{W}' contained conceal cchar=Ŵ + syn match texMathSymbol '\\hat{y}' contained conceal cchar=ŷ + syn match texMathSymbol '\\hat{Y}' contained conceal cchar=Ŷ + endif + + " Greek {{{2 + if s:tex_conceal =~ 'g' + fun! s:Greek(group,pat,cchar) + exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar + endfun + call s:Greek('texGreek','\\alpha\>' ,'α') + call s:Greek('texGreek','\\beta\>' ,'β') + call s:Greek('texGreek','\\gamma\>' ,'γ') + call s:Greek('texGreek','\\delta\>' ,'δ') + call s:Greek('texGreek','\\epsilon\>' ,'ϵ') + call s:Greek('texGreek','\\varepsilon\>' ,'ε') + call s:Greek('texGreek','\\zeta\>' ,'ζ') + call s:Greek('texGreek','\\eta\>' ,'η') + call s:Greek('texGreek','\\theta\>' ,'θ') + call s:Greek('texGreek','\\vartheta\>' ,'ϑ') + call s:Greek('texGreek','\\kappa\>' ,'κ') + call s:Greek('texGreek','\\lambda\>' ,'λ') + call s:Greek('texGreek','\\mu\>' ,'μ') + call s:Greek('texGreek','\\nu\>' ,'ν') + call s:Greek('texGreek','\\xi\>' ,'ξ') + call s:Greek('texGreek','\\pi\>' ,'π') + call s:Greek('texGreek','\\varpi\>' ,'ϖ') + call s:Greek('texGreek','\\rho\>' ,'ρ') + call s:Greek('texGreek','\\varrho\>' ,'ϱ') + call s:Greek('texGreek','\\sigma\>' ,'σ') + call s:Greek('texGreek','\\varsigma\>' ,'ς') + call s:Greek('texGreek','\\tau\>' ,'τ') + call s:Greek('texGreek','\\upsilon\>' ,'υ') + call s:Greek('texGreek','\\phi\>' ,'φ') + call s:Greek('texGreek','\\varphi\>' ,'ϕ') + call s:Greek('texGreek','\\chi\>' ,'χ') + call s:Greek('texGreek','\\psi\>' ,'ψ') + call s:Greek('texGreek','\\omega\>' ,'ω') + call s:Greek('texGreek','\\Gamma\>' ,'Γ') + call s:Greek('texGreek','\\Delta\>' ,'Δ') + call s:Greek('texGreek','\\Theta\>' ,'Θ') + call s:Greek('texGreek','\\Lambda\>' ,'Λ') + call s:Greek('texGreek','\\Xi\>' ,'Χ') + call s:Greek('texGreek','\\Pi\>' ,'Π') + call s:Greek('texGreek','\\Sigma\>' ,'Σ') + call s:Greek('texGreek','\\Upsilon\>' ,'Υ') + call s:Greek('texGreek','\\Phi\>' ,'Φ') + call s:Greek('texGreek','\\Psi\>' ,'Ψ') + call s:Greek('texGreek','\\Omega\>' ,'Ω') + delfun s:Greek + endif + + " Superscripts/Subscripts {{{2 + if s:tex_conceal =~ 's' + syn region texSuperscript matchgroup=Delimiter start='\^{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSuperscripts,texStatement,texSubscript,texSuperscript,texMathMatcher + syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher + fun! s:SuperSub(group,leader,pat,cchar) + exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar + exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' + endfun + call s:SuperSub('texSuperscript','\^','0','⁰') + call s:SuperSub('texSuperscript','\^','1','¹') + call s:SuperSub('texSuperscript','\^','2','²') + call s:SuperSub('texSuperscript','\^','3','³') + call s:SuperSub('texSuperscript','\^','4','⁴') + call s:SuperSub('texSuperscript','\^','5','⁵') + call s:SuperSub('texSuperscript','\^','6','⁶') + call s:SuperSub('texSuperscript','\^','7','⁷') + call s:SuperSub('texSuperscript','\^','8','⁸') + call s:SuperSub('texSuperscript','\^','9','⁹') + call s:SuperSub('texSuperscript','\^','a','ᵃ') + call s:SuperSub('texSuperscript','\^','b','ᵇ') + call s:SuperSub('texSuperscript','\^','c','ᶜ') + call s:SuperSub('texSuperscript','\^','d','ᵈ') + call s:SuperSub('texSuperscript','\^','e','ᵉ') + call s:SuperSub('texSuperscript','\^','f','ᶠ') + call s:SuperSub('texSuperscript','\^','g','ᵍ') + call s:SuperSub('texSuperscript','\^','h','ʰ') + call s:SuperSub('texSuperscript','\^','i','ⁱ') + call s:SuperSub('texSuperscript','\^','j','ʲ') + call s:SuperSub('texSuperscript','\^','k','ᵏ') + call s:SuperSub('texSuperscript','\^','l','ˡ') + call s:SuperSub('texSuperscript','\^','m','ᵐ') + call s:SuperSub('texSuperscript','\^','n','ⁿ') + call s:SuperSub('texSuperscript','\^','o','ᵒ') + call s:SuperSub('texSuperscript','\^','p','ᵖ') + call s:SuperSub('texSuperscript','\^','r','ʳ') + call s:SuperSub('texSuperscript','\^','s','ˢ') + call s:SuperSub('texSuperscript','\^','t','ᵗ') + call s:SuperSub('texSuperscript','\^','u','ᵘ') + call s:SuperSub('texSuperscript','\^','v','ᵛ') + call s:SuperSub('texSuperscript','\^','w','ʷ') + call s:SuperSub('texSuperscript','\^','x','ˣ') + call s:SuperSub('texSuperscript','\^','y','ʸ') + call s:SuperSub('texSuperscript','\^','z','ᶻ') + call s:SuperSub('texSuperscript','\^','A','ᴬ') + call s:SuperSub('texSuperscript','\^','B','ᴮ') + call s:SuperSub('texSuperscript','\^','D','ᴰ') + call s:SuperSub('texSuperscript','\^','E','ᴱ') + call s:SuperSub('texSuperscript','\^','G','ᴳ') + call s:SuperSub('texSuperscript','\^','H','ᴴ') + call s:SuperSub('texSuperscript','\^','I','ᴵ') + call s:SuperSub('texSuperscript','\^','J','ᴶ') + call s:SuperSub('texSuperscript','\^','K','ᴷ') + call s:SuperSub('texSuperscript','\^','L','ᴸ') + call s:SuperSub('texSuperscript','\^','M','ᴹ') + call s:SuperSub('texSuperscript','\^','N','ᴺ') + call s:SuperSub('texSuperscript','\^','O','ᴼ') + call s:SuperSub('texSuperscript','\^','P','ᴾ') + call s:SuperSub('texSuperscript','\^','R','ᴿ') + call s:SuperSub('texSuperscript','\^','T','ᵀ') + call s:SuperSub('texSuperscript','\^','U','ᵁ') + call s:SuperSub('texSuperscript','\^','W','ᵂ') + call s:SuperSub('texSuperscript','\^',',','︐') + call s:SuperSub('texSuperscript','\^',':','︓') + call s:SuperSub('texSuperscript','\^',';','︔') + call s:SuperSub('texSuperscript','\^','+','⁺') + call s:SuperSub('texSuperscript','\^','-','⁻') + call s:SuperSub('texSuperscript','\^','<','˂') + call s:SuperSub('texSuperscript','\^','>','˃') + call s:SuperSub('texSuperscript','\^','/','ˊ') + call s:SuperSub('texSuperscript','\^','(','⁽') + call s:SuperSub('texSuperscript','\^',')','⁾') + call s:SuperSub('texSuperscript','\^','\.','˙') + call s:SuperSub('texSuperscript','\^','=','˭') + call s:SuperSub('texSubscript','_','0','₀') + call s:SuperSub('texSubscript','_','1','₁') + call s:SuperSub('texSubscript','_','2','₂') + call s:SuperSub('texSubscript','_','3','₃') + call s:SuperSub('texSubscript','_','4','₄') + call s:SuperSub('texSubscript','_','5','₅') + call s:SuperSub('texSubscript','_','6','₆') + call s:SuperSub('texSubscript','_','7','₇') + call s:SuperSub('texSubscript','_','8','₈') + call s:SuperSub('texSubscript','_','9','₉') + call s:SuperSub('texSubscript','_','a','ₐ') + call s:SuperSub('texSubscript','_','e','ₑ') + call s:SuperSub('texSubscript','_','i','ᵢ') + call s:SuperSub('texSubscript','_','o','ₒ') + call s:SuperSub('texSubscript','_','u','ᵤ') + call s:SuperSub('texSubscript','_',',','︐') + call s:SuperSub('texSubscript','_','+','₊') + call s:SuperSub('texSubscript','_','-','₋') + call s:SuperSub('texSubscript','_','/','ˏ') + call s:SuperSub('texSubscript','_','(','₍') + call s:SuperSub('texSubscript','_',')','₎') + call s:SuperSub('texSubscript','_','\.','‸') + call s:SuperSub('texSubscript','_','r','ᵣ') + call s:SuperSub('texSubscript','_','v','ᵥ') + call s:SuperSub('texSubscript','_','x','ₓ') + call s:SuperSub('texSubscript','_','\\beta\>' ,'ᵦ') + call s:SuperSub('texSubscript','_','\\delta\>','ᵨ') + call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') + call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') + call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') + delfun s:SuperSub + endif + + " Accented characters: {{{2 + if s:tex_conceal =~ 'a' + if b:tex_stylish + syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 + syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 + else + fun! s:Accents(chr,...) + let i= 1 + for accent in ["`","\\'","^",'"','\~','\.',"c","H","k","r","u","v"] + if i > a:0 + break + endif + if strlen(a:{i}) == 0 || a:{i} == ' ' || a:{i} == '?' + let i= i + 1 + continue + endif + if accent =~ '\a' + exe "syn match texAccent '".'\\'.accent.'\(\s*{'.a:chr.'}\|\s\+'.a:chr.'\)'."' conceal cchar=".a:{i} + else + exe "syn match texAccent '".'\\'.accent.'\s*\({'.a:chr.'}\|'.a:chr.'\)'."' conceal cchar=".a:{i} + endif + let i= i + 1 + endfor + endfun + " \` \' \^ \" \~ \. \c \H \k \r \u \v + call s:Accents('a','à','á','â','ä','ã','ȧ',' ',' ','ą','å','ă','ă') + call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ',' ',' ','Ą','Å','Ă','Ă') + call s:Accents('c',' ','ć','ĉ',' ',' ','ċ','ç',' ',' ',' ',' ','č') + call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ','Ç',' ',' ',' ',' ','Č') + call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď') + call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď') + call s:Accents('e','è','é','ê','ë','ẽ','ė','ȩ',' ','ę',' ','ĕ','ě') + call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ȩ',' ','Ę',' ','Ĕ','Ě') + call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ','ģ',' ',' ',' ','ğ',' ') + call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ','Ģ',' ',' ',' ','Ğ',' ') + call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ') + call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ') + call s:Accents('i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ','ĭ',' ') + call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ',' ',' ',' ',' ','Ĭ',' ') + call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ') + call s:Accents('k',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ',' ') + call s:Accents('K',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ',' ') + call s:Accents('l',' ','ĺ','ľ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ') + call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ') + call s:Accents('n',' ','ń',' ',' ','ñ',' ','ņ',' ',' ',' ',' ','ň') + call s:Accents('N',' ','Ń',' ',' ','Ñ',' ','Ņ',' ',' ',' ',' ','Ň') + call s:Accents('o','ò','ó','ô','ö','õ','ȯ',' ','ő','ǫ',' ','ŏ',' ') + call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ',' ','Ő','Ǫ',' ','Ŏ',' ') + call s:Accents('r',' ','ŕ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř') + call s:Accents('R',' ','Ŕ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř') + call s:Accents('s',' ','ś','ŝ',' ',' ',' ','ş',' ','ȿ',' ',' ','š') + call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ','Ş',' ',' ',' ',' ','Š') + call s:Accents('t',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť') + call s:Accents('T',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť') + call s:Accents('u','ù','ú','û','ü','ũ',' ',' ','ű','ų','ů','ŭ','ǔ') + call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ',' ','Ű','Ų','Ů','Ŭ','Ǔ') + call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ','ž') + call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ','Ž') + call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ','ĭ',' ') + " \` \' \^ \" \~ \. \c \H \k \r \u \v + delfun s:Accents + syn match texAccent '\\aa\>' conceal cchar=å + syn match texAccent '\\AA\>' conceal cchar=Å + syn match texAccent '\\o\>' conceal cchar=ø + syn match texAccent '\\O\>' conceal cchar=Ø + syn match texLigature '\\AE\>' conceal cchar=Æ + syn match texLigature '\\ae\>' conceal cchar=æ + syn match texLigature '\\oe\>' conceal cchar=œ + syn match texLigature '\\OE\>' conceal cchar=Œ + syn match texLigature '\\ss\>' conceal cchar=ß + endif + endif +endif + +" --------------------------------------------------------------------- +" LaTeX synchronization: {{{1 +syn sync maxlines=200 +syn sync minlines=50 + +syn sync match texSyncStop groupthere NONE "%stopzone\>" + +" Synchronization: {{{1 +" The $..$ and $$..$$ make for impossible sync patterns +" (one can't tell if a "$$" starts or stops a math zone by itself) +" The following grouptheres coupled with minlines above +" help improve the odds of good syncing. +if !exists("tex_no_math") + syn sync match texSyncMathZoneA groupthere NONE "\\end{abstract}" + syn sync match texSyncMathZoneA groupthere NONE "\\end{center}" + syn sync match texSyncMathZoneA groupthere NONE "\\end{description}" + syn sync match texSyncMathZoneA groupthere NONE "\\end{enumerate}" + syn sync match texSyncMathZoneA groupthere NONE "\\end{itemize}" + syn sync match texSyncMathZoneA groupthere NONE "\\end{table}" + syn sync match texSyncMathZoneA groupthere NONE "\\end{tabular}" + syn sync match texSyncMathZoneA groupthere NONE "\\\(sub\)*section\>" +endif + +" --------------------------------------------------------------------- +" Highlighting: {{{1 +if did_tex_syntax_inits == 1 + let did_tex_syntax_inits= 2 + " TeX highlighting groups which should share similar highlighting + if !exists("g:tex_no_error") + if !exists("tex_no_math") + HiLink texBadMath texError + HiLink texMathDelimBad texError + HiLink texMathError texError + if !b:tex_stylish + HiLink texOnlyMath texError + endif + endif + HiLink texError Error + endif + + hi texBoldStyle gui=bold cterm=bold + hi texItalStyle gui=italic cterm=italic + hi texBoldItalStyle gui=bold,italic cterm=bold,italic + hi texItalBoldStyle gui=bold,italic cterm=bold,italic + HiLink texCite texRefZone + HiLink texDefCmd texDef + HiLink texDefName texDef + HiLink texDocType texCmdName + HiLink texDocTypeArgs texCmdArgs + HiLink texInputFileOpt texCmdArgs + HiLink texInputCurlies texDelimiter + HiLink texLigature texSpecialChar + if !exists("tex_no_math") + HiLink texMathDelimSet1 texMathDelim + HiLink texMathDelimSet2 texMathDelim + HiLink texMathDelimKey texMathDelim + HiLink texMathMatcher texMath + HiLink texAccent texStatement + HiLink texGreek texStatement + HiLink texSuperscript texStatement + HiLink texSubscript texStatement + HiLink texSuperscripts texSuperscript + HiLink texSubscripts texSubscript + HiLink texMathSymbol texStatement + HiLink texMathZoneV texMath + HiLink texMathZoneW texMath + HiLink texMathZoneX texMath + HiLink texMathZoneY texMath + HiLink texMathZoneV texMath + HiLink texMathZoneZ texMath + endif + HiLink texBeginEnd texCmdName + HiLink texBeginEndName texSection + HiLink texSpaceCode texStatement + HiLink texStyleStatement texStatement + HiLink texTypeSize texType + HiLink texTypeStyle texType + + " Basic TeX highlighting groups + HiLink texCmdArgs Number + HiLink texCmdName Statement + HiLink texComment Comment + HiLink texDef Statement + HiLink texDefParm Special + HiLink texDelimiter Delimiter + HiLink texInput Special + HiLink texInputFile Special + HiLink texLength Number + HiLink texMath Special + HiLink texMathDelim Statement + HiLink texMathOper Operator + HiLink texNewCmd Statement + HiLink texNewEnv Statement + HiLink texOption Number + HiLink texRefZone Special + HiLink texSection PreCondit + HiLink texSpaceCodeChar Special + HiLink texSpecialChar SpecialChar + HiLink texStatement Statement + HiLink texString String + HiLink texTodo Todo + HiLink texType Type + HiLink texZone PreCondit + + delcommand HiLink +endif + +" Keywords can contain colons +setlocal iskeyword+=: + +" l3skip package macros {{{ +"syn match l3skip_macros "x" +syn match l3skip_macros "\\dim_new:[Nc]" +syn match l3skip_macros "\\dim_[g]zero:[Nc]" +syn match l3skip_macros "\\dim_[g]add:[Nc]n" +syn match l3skip_macros "\\dim_[g]set:[Nc]n" +syn match l3skip_macros "\\dim_[g]set_eq:[Nc][Nc]" +syn match l3skip_macros "\\dim_set_max:[Nc]n" +syn match l3skip_macros "\\dim_set_min:[Nc]n" + +highlight link l3skip_macros Statement + +" }}} + +" General package macros {{{ +syn match l3_macros "\\[A-Za-z_]*:[DNncVvoxfTFpw]*" +highlight link l3_macros Statement +" }}} + +" }}} + +" Variables {{{ +syn match bool_vars "\\\?[lgc]_[A-Za-z_]*_bool" +syn match box_vars "\\\?[lgc]_[A-Za-z_]*_box" +syn match clist_vars "\\\?[lgc]_[A-Za-z_]*_clist" +syn match coffin_vars "\\\?[lgc]_[A-Za-z_]*_coffin" +syn match dim_vars "\\\?[lgc]_[A-Za-z_]*_dim" +syn match fp_vars "\\\?[lgc]_[A-Za-z_]*_fp" +syn match int_vars "\\\?[lgc]_[A-Za-z_]*_int" +syn match prop_vars "\\\?[lgc]_[A-Za-z_]*_prop" +syn match seq_vars "\\\?[lgc]_[A-Za-z_]*_seq" +syn match skip_vars "\\\?[lgc]_[A-Za-z_]*_skip" +syn match stream_vars "\\\?[lgc]_[A-Za-z_]*_stream" +syn match stream_vars "\\\?[lgc]_[A-Za-z_]*_iow" +syn match stream_vars "\\\?[lgc]_[A-Za-z_]*_ior" +syn match tl_vars "\\\?[lgc]_[A-Za-z_]*_tl" + +highlight link bool_vars Identifier +highlight link box_vars Identifier +highlight link clist_vars Identifier +highlight link coffin_vars Identifier +highlight link dim_vars Identifier +highlight link fp_vars Identifier +highlight link int_vars Identifier +highlight link prop_vars Identifier +highlight link seq_vars Identifier +highlight link skip_vars Identifier +highlight link stream_vars Identifier +highlight link tl_vars Identifier + +" }}} + +" Cleanup: {{{1 +unlet s:extfname +let b:current_syntax = "tex" +let &cpo = s:keepcpo +unlet s:keepcpo +" vim: ts=8 fdm=marker diff --git a/syntax/tolua.vim b/syntax/tolua.vim new file mode 100644 index 0000000..33c1ced --- /dev/null +++ b/syntax/tolua.vim @@ -0,0 +1,41 @@ +if exists("b:current_syntax") + finish +endif + +syn include @EmbeddedLua syntax/lua.vim +syn include @EmbeddedPreproc syntax/c.vim + +syn match toluaString "\".*\"" +syn match toluaInclude "<.*>" +syn region toluaEmbeddedLua matchgroup=toluaEmbeddedDelimiter + \ start="^\$\[" end="^\$\]" contains=@EmbeddedLua +syn match toluaCInclude "^\$#.*$" contains=toluaString,toluaInclude + +syn keyword toluaStatement module nextgroup=toluaModuleName skipwhite +syn match toluaModuleName "[_a-zA-Z]\+" contained + +syn match toluaRename "@ [_a-zA-Z]\+" + +" from c syntax file +syn keyword cType int long short char void +syn keyword cType signed unsigned float double +syn keyword luaState lua_State + +syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell extend +syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend +syn keyword cStructure struct union enum typedef +syn keyword cStorageClass static register auto volatile extern const + +let b:current_syntax = "tolua" + +hi def link toluaEmbeddedDelimiter Special +hi def link toluaCInclude PreProc +hi def link toluaString String +hi def link toluaInclude String +hi def link toluaStatement Statement +hi def link toluaModuleName Identifier +hi def link toluaRename Special +hi def link cType Type +hi def link luaState Type +hi def link cStorageClass StorageClass +hi def link cStructure Structure diff --git a/syntax/xwiki.vim b/syntax/xwiki.vim new file mode 100644 index 0000000..ec3e036 --- /dev/null +++ b/syntax/xwiki.vim @@ -0,0 +1,52 @@ +if exists("b:current_syntax") + finish +endif + +runtime! syntax/html.vim +unlet! b:current_syntax + +for i in range(1,6) + exe "syn region xwikiHeading" . i . " start='^" + \ . repeat("=", i) . "' end='" . repeat("=", i) . "$'" + \ . " contains=@xwikiFormat" + exe "syn cluster xwikiHeadings add=xwikiHeading" . i + exe "hi def link xwikiHeading" . i . " htmlH" . i +endfor + +syn region xwikiBold start="\*\*" end="\*\*" + \ contains=xwikiItalic,xwikiMonospace,xwikiUnderline,xwikiStriked,xwikiSuperscript,xwikiSubscript +syn region xwikiItalic start="\(\a\+:\)\@