"Fossies" - the Fresh Open Source Software Archive

Member "msmtp-1.8.5/scripts/vim/msmtp.vim" (11 Jul 2019, 3018 Bytes) of package /linux/privat/msmtp-1.8.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) vimscript source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 " Vim syntax file
    2 " Language:     msmtp rc files
    3 " Maintainer:   Simon Ruderich <simon@ruderich.com>
    4 "               Eric Pruitt <eric.pruitt@gmail.com>
    5 " Last Change:  2019-06-13
    6 " Filenames:    msmtprc
    7 " Version:      0.3
    8 
    9 
   10 if version < 600
   11   syntax clear
   12 elseif exists("b:current_syntax")
   13   finish
   14 endif
   15 
   16 
   17 " Comments.
   18 syn match msmtpComment /#.*$/ contains=@Spell
   19 
   20 " General commands.
   21 syntax match msmtpOption /\<\(defaults\|account\|host\|port\|proxy_host\|proxy_port\|timeout\|protocol\|domain\)\>/
   22 " Authentication commands.
   23 syntax match msmtpOption /\<\(auth\|user\|password\|passwordeval\|ntlmdomain\)\>/
   24 " TLS commands.
   25 syntax match msmtpOption /\<\(tls\|tls_trust_file\|tls_crl_file\|tls_fingerprint\|tls_key_file\|tls_cert_file\|tls_certcheck\|tls_starttls\|tls_min_dh_prime_bits\|tls_priorities\)\>/
   26 " Sendmail mode specific commands.
   27 syntax match msmtpOption /\<\(auto_from\|from\|maildomain\|dsn_notify\|dsn_return\|add_missing_from_header\|add_missing_date_header\|remove_bcc_headers\|logfile\|logfile_time_format\|syslog\)\>/
   28 
   29 " Options which accept only an on/off value.
   30 syn match msmtpWrongOption /\<\(tls\|tls_certcheck\|tls_starttls\|auto_from\|add_missing_from_header\|add_missing_date_header\|remove_bcc_headers\) \(on$\|off$\)\@!.*$/
   31 " Option port accepts numeric values.
   32 syn match msmtpWrongOption /\<\(port\|proxy_port\) \(\d\+$\)\@!.*$/
   33 " Option timeout accepts off and numeric values.
   34 syn match msmtpWrongOption /\<timeout \(off$\|\d\+$\)\@!.*$/
   35 " Option protocol accepts smtp and lmtp.
   36 syn match msmtpWrongOption /\<protocol \(smtp$\|lmtp$\)\@!.*$/
   37 " Option auth accepts on, off and the method.
   38 syn match msmtpWrongOption /\<auth \(on$\|off$\|plain$\|cram-md5$\|digest-md5$\|scram-sha-1$\|gssapi$\|external$\|login$\|ntlm$\|oauthbearer\)\@!.*$/
   39 " Option auth accepts on, off and the facility.
   40 syn match msmtpWrongOption /\<syslog \(on$\|off$\|LOG_USER$\|LOG_MAIL$\|LOG_LOCAL\d$\)\@!.*$/
   41 
   42 " Marks all wrong option values as errors.
   43 syn match msmtpWrongOptionValue /\S* \zs.*$/ contained containedin=msmtpWrongOption
   44 
   45 " Mark the option part as a normal option.
   46 highlight default link msmtpWrongOption msmtpOption
   47 
   48 "Email addresses (yanked from esmptrc)
   49 syntax match msmtpAddress /[a-z0-9_.-]*[a-z0-9]\+@[a-z0-9_.-]*[a-z0-9]\+\.[a-z]\+/
   50 " Host names
   51 syn match msmtpHost "\%(host\s*\)\@<=\h\%(\w\|\.\|-\)*"
   52 syn match msmtpHost "\%(host\s*\)\@<=\%([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)"
   53 " Numeric values
   54 syn match msmtpNumber /\<\(\d\+$\)/
   55 "Strings
   56 syntax region msmtpString start=/"/ end=/"/
   57 syntax region msmtpString start=/'/ end=/'/
   58 " Booleans
   59 syntax match msmtpBool "\s\@<=\(on\|off\)$"
   60 
   61 highlight default link msmtpComment Comment
   62 highlight default link msmtpOption Type
   63 highlight default link msmtpWrongOptionValue Error
   64 highlight default link msmtpString String
   65 highlight default link msmtpAddress Constant
   66 highlight default link msmtpNumber Number
   67 highlight default link msmtpHost Identifier
   68 highlight default link msmtpBool Constant
   69 
   70 
   71 let b:current_syntax = "msmtp"