]> git.notmuchmail.org Git - notmuch/blobdiff - vim/syntax/notmuch-show.vim
first attempt to fold the message nicely
[notmuch] / vim / syntax / notmuch-show.vim
index 06dd2ea2a262d1e45e535184242b45b13c2d08d7..02e12e997141c30762ee8f4ac080334e47bc8022 100644 (file)
@@ -1,13 +1,20 @@
 " 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
+syntax region nmShowMessage    start='\fmessage{'    end='\fmessage}'    contains=nmBlockStart,nmShowHeader,nmShowBody,nmShowAttachment,nmShowPart,nmBlockEnd
+syntax region nmShowHeader     start='\fheader{'     end='\fheader}'     contained contains=nmBlockStart,nmBlockEnd
+syntax region nmShowBody       start='\fbody{'       end='\fbody}'       contained contains=nmBlockStart,nmShowAttachment,nmShowPart,nmBlockEnd
+syntax region nmShowAttachment start='\fattachment{' end='\fattachment}' contained contains=nmBlockStart,nmBlockEnd
+syntax region nmShowPart       start='\fpart{'       end='\fpart}'       contained contains=nmBlockStart,nmBlockEnd
+
+syntax region nmBlockStart     start='^\f[a-z]\+{'    end='$'            oneline
+syntax region nmBlockEnd       start='^\f[a-z]\+}'    end='$'            oneline
 
 highlight link nmShowMessage    Error
 highlight link nmShowHeader     Type
 highlight link nmShowBody       Statement
 highlight link nmShowAttachment Statement
 highlight link nmShowPart       String
+highlight link nmBlockStart     Ignore
+highlight link nmBlockEnd       Ignore
+
+highlight Folded term=reverse ctermfg=LightGrey ctermbg=Black guifg=LightGray guibg=Black