]> git.notmuchmail.org Git - notmuch/blobdiff - vim/syntax/notmuch-show.vim
vim: add git-diff.vim in README, make syntax work w/o the script
[notmuch] / vim / syntax / notmuch-show.vim
index 06dd2ea2a262d1e45e535184242b45b13c2d08d7..20bcc3996d42c908c09e03c909105b241599cb1f 100644 (file)
@@ -1,13 +1,25 @@
 " notmuch show mode syntax file
 
-syntax region nmShowMessage    start="\fmessage{"    end="\fmessage}"    contains=nmShowHeader,nmShowBody,nmShowAttachment,nmShowPart
-syntax region nmShowHeader     start="\fheader{"     end="\fheader}"     contained
-syntax region nmShowBody       start="\fbody{"       end="\fbody}"       contained contains=nmShowAttachment,nmShowPart
-syntax region nmShowAttachment start="\fattachment{" end="\fattachment}" contained
-syntax region nmShowPart       start="\fpart{"       end="\fpart}"       contained
-
-highlight link nmShowMessage    Error
-highlight link nmShowHeader     Type
-highlight link nmShowBody       Statement
-highlight link nmShowAttachment Statement
-highlight link nmShowPart       String
+syntax cluster nmShowMsgDesc contains=nmShowMsgDescWho,nmShowMsgDescDate,nmShowMsgDescTags
+syntax match   nmShowMsgDescWho /[^)]\+)/ contained
+syntax match   nmShowMsgDescDate / ([^)]\+[0-9]) / contained
+syntax match   nmShowMsgDescTags /([^)]\+)$/ contained
+
+syntax cluster nmShowMsgHead contains=nmShowMsgHeadKey,nmShowMsgHeadVal
+syntax match   nmShowMsgHeadKey /^[^:]\+: / contained
+syntax match   nmShowMsgHeadVal /^\([^:]\+: \)\@<=.*/ contained
+
+syntax cluster nmShowMsgBody contains=@nmShowMsgBodyMail,@nmShowMsgBodyGit
+syntax include @nmShowMsgBodyMail syntax/mail.vim
+
+" git-diff.vim marks up diffs in emails, see README for details
+silent! syntax include @nmShowMsgBodyGit syntax/git-diff.vim
+
+highlight nmShowMsgDescWho term=reverse cterm=reverse gui=reverse
+highlight link nmShowMsgDescDate Type
+highlight link nmShowMsgDescTags String
+
+highlight link nmShowMsgHeadKey  Macro
+"highlight link nmShowMsgHeadVal  NONE
+
+highlight Folded term=reverse ctermfg=LightGrey ctermbg=Black guifg=LightGray guibg=Black