added syntax files for search and show screens
authorBart Trojanowski <bart@jukie.net>
Thu, 19 Nov 2009 02:00:43 +0000 (21:00 -0500)
committerBart Trojanowski <bart@jukie.net>
Wed, 25 Nov 2009 05:48:49 +0000 (00:48 -0500)
vim/syntax/notmuch-search.vim [new file with mode: 0644]
vim/syntax/notmuch-show.vim [new file with mode: 0644]

diff --git a/vim/syntax/notmuch-search.vim b/vim/syntax/notmuch-search.vim
new file mode 100644 (file)
index 0000000..eb7d88f
--- /dev/null
@@ -0,0 +1,22 @@
+" notmuch search mode syntax file
+
+" TODO: I cannot figure out why nmSearchTags is not matching anything :(
+
+syntax region nmSearchDate      start="^" end="\%13v"
+syntax region nmSearchCountAndFrom start="\%14v\[" end=";" oneline contains=nmSearchCount,nmSearchFrom
+syntax match  nmSearchFrom      ' .*;'                     contained
+syntax region nmSearchCount     start="\%14v\[" end="\]"   contained contains=nmSearchCountZero,nmSearchCountSome,nmSearchCountAll
+syntax match  nmSearchCountZero '0/\(\d\+\)'               contained
+syntax match  nmSearchCountSome '\([1-9]\d*\)/\(\d\+\)'    contained
+syntax match  nmSearchCountAll  '\(\d\+\)/\1'              contained
+syntax match  nmSearchTags      /([^)]\+)$/
+
+highlight link nmSearchDate      Statement
+"highlight link nmSearchCount     Comment
+highlight link nmSearchCountZero Function
+highlight link nmSearchCountSome Special
+highlight link nmSearchCountAll  Type
+highlight link nmSearchFrom      Include
+highlight link nmSearchTags      String
+
+highlight CursorLine term=reverse cterm=reverse gui=reverse
diff --git a/vim/syntax/notmuch-show.vim b/vim/syntax/notmuch-show.vim
new file mode 100644 (file)
index 0000000..06dd2ea
--- /dev/null
@@ -0,0 +1,13 @@
+" 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