]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - vim/vim/syntax/msmtp.vim
1b0f8df554e0800df68bf67c3da9976a10b32ec2
[config/dotfiles.git] / vim / vim / syntax / msmtp.vim
1 " Vim syntax file
2 " Language:     msmtp rc files
3 " Maintainer:   Simon Ruderich <simon@ruderich.org>
4 " Last Change:  2008-08-23
5 " Filenames:    msmtprc
6 " Version:      0.1
7
8
9 if version < 600
10   syntax clear
11 elseif exists("b:current_syntax")
12   finish
13 endif
14
15
16 " Comments.
17 syn match msmtpComment /#.*$/ contains=@Spell
18
19 " General commands.
20 syntax match msmtpOption /\<\(defaults\|account\|host\|port\|timeout\|protocol\|domain\)\>/
21 " Authentication commands.
22 syntax match msmtpOption /\<\(auth\|user\|password\|passwordeval\|ntlmdomain\)\>/
23 " TLS commands.
24 syntax match msmtpOption /\<\(tls\|tls_trust_file\|tls_crl_file\|tls_fingerprint\|tls_key_file\|tls_cert_file\|tls_certcheck\|tls_starttls\|tls_force_sslv3\|tls_min_dh_prime_bits\|tls_priorities\)\>/
25 " Sendmail mode specific commands.
26 syntax match msmtpOption /\<\(auto_from\|from\|maildomain\|dsn_notify\|dsn_return\|keepbcc\|logfile\|syslog\)\>/
27
28
29 " Options which accept only an on/off value.
30 syn match msmtpWrongOption /\<\(tls\|tls_certcheck\|tls_starttls\|tls_force_sslv3\|auto_from\|keepbcc\) \(on$\|off$\)\@!.*$/
31 " Option port accepts numeric values.
32 syn match msmtpWrongOption /\<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$\)\@!.*$/
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 highlight default link msmtpComment Comment
49 highlight default link msmtpOption Type
50 highlight default link msmtpWrongOptionValue Error
51
52 let b:current_syntax = "msmtp"