From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Cc: Bart Trojanowski <bart@jukie.net>
Subject: [PATCH 4/9] vim: cleanup search syntax
Date: Sat, 5 Jun 2010 14:12:37 +0300 [thread overview]
Message-ID: <1275736362-22771-5-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1275736362-22771-1-git-send-email-felipe.contreras@gmail.com>
It was *sloooooow*.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/syntax/notmuch-search.vim | 36 ++++++++++++------------------------
1 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/vim/syntax/notmuch-search.vim b/vim/syntax/notmuch-search.vim
index 71839fd..f458d77 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
--
1.7.1
next prev parent reply other threads:[~2010-06-05 11:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-05 11:12 [PATCH 0/9] vim improvements Felipe Contreras
2010-06-05 11:12 ` [PATCH 1/9] thread: really clean authors Felipe Contreras
2010-06-05 11:12 ` [PATCH 2/9] vim: add archive support from 'show' Felipe Contreras
2010-06-05 11:12 ` [PATCH 3/9] vim: cleanup search buffer Felipe Contreras
2010-06-05 11:12 ` Felipe Contreras [this message]
2010-06-05 11:12 ` [PATCH 5/9] vim: remove add_remove_tags_on_screen() Felipe Contreras
2010-06-05 11:12 ` [PATCH 6/9] vim: add option to mark as read + archive Felipe Contreras
2010-06-05 11:12 ` [PATCH 7/9] vim: use mailx for sending Felipe Contreras
2010-06-16 18:28 ` Felipe Contreras
2010-06-05 11:12 ` [PATCH 8/9] vim: run(): optimize non-debug path Felipe Contreras
2010-06-05 11:12 ` [PATCH 9/9] vim: include own improved git-diff syntax Felipe Contreras
2010-11-08 17:57 ` [PATCH 0/9] vim improvements Carl Worth
2010-11-08 18:04 ` Carl Worth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1275736362-22771-5-git-send-email-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--cc=bart@jukie.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).