mbsync.vim (3759B)
1 " Vim syntax file 2 " Language: mbsync setup files 3 " Maintainer: Stephen Gregoratto <themanhimself@sgregoratto.me> 4 " Last Change: 2018-03-13 5 " Filenames: mbsyncrc 6 " Version: 0.2 7 " Licence: GPLv3+ 8 " 9 " Note: This config borrows heavily from msmtprc.vim 10 " by Simon Ruderich and Eric Pruitt 11 12 if version < 600 13 syntax clear 14 elseif exists("b:current_syntax") 15 finish 16 endif 17 18 " OPTIONS - Ripped directly from mbsync(1) 19 " All Stores 20 syntax match mbsyncOption /^\<\(Path\|MaxSize\|MapInbox\|Flatten\|Trash\|TrashNewOnly\|TrashRemoteNew\)\>/ 21 " Maildir Stores 22 syntax match mbsyncOption /^\<\(MaildirStore\|AltMap\|Inbox\|InfoDelimiter\|SubFolders\)\>/ 23 " IMAP4 Account 24 syntax match mbsyncOption /^\<\(IMAPAccount\|Host\|Port\|Timeout\|User\|Pass\|PassCmd\|Tunnel\|AuthMechs\|SSLType\|SSLVersions\|SystemCertificates\|CertificateFile\|ClientCertificate\|ClientKey\|PipelineDepth\|DisableExtension.*\)\>/ 25 " IMAP Stores 26 syntax match mbsyncOption /^\<\(IMAPStore\|Account\|UseNameSpace\|PathDelimiter\)\>/ 27 " Channels 28 syntax match mbsyncOption /^\<\(Channel\|Master\|Slave\|Pattern\|Patterns\|MaxSize\|MaxMessaages\|ExpireUnread\|Sync\|Create\|Remove\|Expunge\|CopyArrivalDate\|SyncState\)\>/ 29 " Groups 30 syntax match mbsyncOption /^\<\(Group\|Channel\)\>/ 31 " Global 32 syntax match mbsyncOption /^\<\(FSync\|FieldDelimiter\|BufferLimit\)\>/ 33 34 " VALUES 35 " Options that accept only yes|no values 36 syntax match mbsyncWrongOption /^\<\(TrashNewOnly\|TrashRemoteNew\|AltMap\|SystemCertificates\|UseNameSpace\|ExpireUnread\|CopyArrivalDate\|FSync\) \(yes$\|no$\)\@!.*$/ 37 " Option SubFolders accepts Verbatim|Maildir++|Legacy 38 syntax match mbsyncWrongOption /^\<\(SubFolders\) \(Verbatim$\|Maildir++$\|Legacy$\)\@!.*$/ 39 " Option SSLType accepts None|STARTTLS|IMAPS 40 syntax match mbsyncWrongOption /^\<\(SSLType\) \(None$\|STARTTLS$\|IMAPS$\)\@!.*$/ 41 " Option SSLVersions accepts SSLv3|TLSv1|TLSv1.1|TLSv1.2 42 syntax match mbsyncWrongOption /^\<\(SSLVersions\) \(SSLv3$\|TLSv1$\|TLSv1.1$\|TLSv1.2$\)\@!.*$/ 43 " Option Sync 44 syntax match mbsyncWrongOption /^\<\(Sync\) \(None$\|Pull$\|Push$\|New$\|ReNew$\|Delete$\|Flags$\|All$\)\@!.*$/ 45 " Options Create|Remove|Expunge accept None|Master|Slave|Both 46 syntax match mbsyncWrongOption /^\<\(Create\|Remove\|Expunge\) \(None$\|Master$\|Slave$\|Both$\)\@!.*$/ 47 " Marks all wrong option values as errors. 48 syntax match mbsyncWrongOptionValue /\S* \zs.*$/ contained containedin=mbsyncWrongOption 49 " Mark the option part as a normal option. 50 highlight default link mbsyncWrongOption mbsyncOption 51 52 " SPECIALS 53 " Email Addresses (yanked from esmptrc) 54 syntax match mbsyncAddress /[a-z0-9_.-]*[a-z0-9]\+@[a-z0-9_.-]*[a-z0-9]\+\.[a-z]\+/ 55 " Host names 56 syntax match mbsyncHost /[a-z0-9_.-]\+\.[a-z]\+$/ 57 " Numeric values 58 syntax match mbsyncNumber /\<\(\d\+$\)/ 59 " File Sizes 60 syntax match mbsyncNumber /\d\+[k|m][b]/ 61 " Master|Slave stores 62 syntax match mbsyncStores /:[^-].*:[^-]*$/ 63 " Strings 64 syntax region mbsyncString start=/"/ end=/"/ 65 syntax region mbsyncString start=/'/ end=/'/ 66 " Comments 67 syntax match mbsyncComment /#.*$/ contains=@Spell 68 " File/Dir paths - Neovim exclusive 69 if has ('nvim') 70 syntax match mbsyncPath "~\%(/[^/]\+\)\+" 71 endif 72 73 highlight default link mbsyncAddress Constant 74 highlight default link mbsyncComment Comment 75 highlight default link mbsyncHost Constant 76 highlight default link mbsyncNumber Number 77 highlight default link mbsyncOption Type 78 highlight default link mbsyncPath Constant 79 highlight default link mbsyncStores Identifier 80 highlight default link mbsyncString String 81 highlight default link mbsyncWrongOptionValue Error 82 83 let b:current_syntax = "mbsync"