aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim
diff options
context:
space:
mode:
authorGravatar Felipe Contreras <felipe.contreras@gmail.com>2010-06-05 14:12:37 +0300
committerGravatar Carl Worth <cworth@cworth.org>2010-11-08 10:00:17 -0800
commit4c3203eca8e3c4c3f222d7dcd24a14fb14a10ae9 (patch)
tree85a1bbdf5c4165f49a30393ee3c40c114f7d2cf4 /vim
parent75633b32209c20f35cb5aa5a19d233450c5b115c (diff)
vim: cleanup search syntax
It was *sloooooow*. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'vim')
-rw-r--r--vim/syntax/notmuch-search.vim36
1 files changed, 12 insertions, 24 deletions
diff --git a/vim/syntax/notmuch-search.vim b/vim/syntax/notmuch-search.vim
index 71839fd9..f458d778 100644
--- a/vim/syntax/notmuch-search.vim
+++ b/vim/syntax/notmuch-search.vim
@@ -1,24 +1,12 @@
-" notmuch search mode syntax file
-
-" TODO: I cannot figure out why nmSearchTags is not matching anything :(
-
-syntax region nmSearchDate start='^' end='\%13v' oneline
-syntax region nmSearchCountAndFrom start='\%14v\[' end='|' oneline contains=nmSearchCount,nmSearchFrom
-syntax region nmSearchCount start='\[' end='\]' oneline contained contains=nmSearchCountZero,nmSearchCountSome,nmSearchCountAll
-syntax region nmSearchFrom start='\]\@<=' end='|' oneline contained
-syntax match nmSearchCountZero '0/\(\d\+\)' contained
-syntax match nmSearchCountSome '\([1-9]\d*\)/\(\d\+\)' contained
-syntax match nmSearchCountAll '\(\d\+\)/\1' contained
-syntax match nmSearchSquareBracketText '\(\[\w\+\]\)'
-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 nmSearchSquareBracketText Special
-highlight link nmSearchTags String
-
-highlight CursorLine term=reverse cterm=reverse gui=reverse
+syntax region nmSearch start=/^/ end=/$/ oneline contains=nmSearchDate
+syntax match nmSearchDate /^.\{-13}/ contained nextgroup=nmSearchNum
+syntax match nmSearchNum /.\{-4}/ contained nextgroup=nmSearchFrom
+syntax match nmSearchFrom /.\{-21}/ contained nextgroup=nmSearchSubject
+syntax match nmSearchSubject /.\{0,}\(([^()]\+)$\)\@=/ contained nextgroup=nmSearchTags
+syntax match nmSearchTags /.\+$/ contained
+
+highlight link nmSearchDate Statement
+highlight link nmSearchNum Type
+highlight link nmSearchFrom Include
+highlight link nmSearchSubject Normal
+highlight link nmSearchTags String