1 Return-Path: <imain@stemwinder.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 19F4C431FC3
\r
6 for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 11:50:23 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id eCNmC8IeftVv for <notmuch@notmuchmail.org>;
\r
16 Mon, 6 Oct 2014 11:50:19 -0700 (PDT)
\r
17 Received: from cmta14.telus.net (cmta14.telus.net [209.171.16.87])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 7FEB7431FAE
\r
19 for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 11:50:19 -0700 (PDT)
\r
20 Received: from ovo.mains.priv ([207.102.88.62]) by cmta14.telus.net with TELUS
\r
21 id zuqJ1o00G1LiWEf01uqJwM; Mon, 06 Oct 2014 12:50:19 -0600
\r
22 X-Authority-Analysis: v=2.0 cv=YvLRsfkX c=1 sm=2
\r
23 a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=S-IsBHyFrF4A:10 a=tsa3CZZnAAAA:8
\r
24 a=kgSvjYviLYQrhIuC7O0A:9 a=I9Z9FZpTuu1KLi6k:21 a=AbTiqZD8YlUZ1nUa:21
\r
25 a=EcQDfIwDZEqJA1f7rVUV8Q==:117
\r
26 X-Telus-Outbound-IP: 207.102.88.62
\r
27 From: Ian Main <imain@stemwinder.org>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH] VIM: Improve search list
\r
30 Date: Mon, 6 Oct 2014 11:50:14 -0700
\r
31 Message-Id: <1412621414-31793-1-git-send-email-imain@stemwinder.org>
\r
32 X-Mailer: git-send-email 1.9.3
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.13
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Mon, 06 Oct 2014 18:50:23 -0000
\r
47 Make the width of the search name column expand/contract with the
\r
48 length of the longest search name string.
\r
50 Fix syntax highlighting to make the above work right.
\r
52 Add the ability to use a blank search pattern to create a spacer
\r
53 to break up searches into groups.
\r
55 vim/notmuch.txt | 4 ++++
\r
56 vim/notmuch.vim | 16 ++++++++++++++--
\r
57 vim/syntax/notmuch-folders.vim | 2 +-
\r
58 3 files changed, 19 insertions(+), 3 deletions(-)
\r
60 diff --git a/vim/notmuch.txt b/vim/notmuch.txt
\r
61 index 4374102..3a73912 100644
\r
62 --- a/vim/notmuch.txt
\r
63 +++ b/vim/notmuch.txt
\r
64 @@ -94,11 +94,15 @@ You can add the following configurations to your `.vimrc`, or
\r
67 The first thing you might want to do is set your custom searches.
\r
69 +Adding an empty set of strings results in a blank line which allows you
\r
70 +to break up searches into groups.
\r
72 let g:notmuch_folders = [
\r
73 \ [ 'new', 'tag:inbox and tag:unread' ],
\r
74 \ [ 'inbox', 'tag:inbox' ],
\r
75 \ [ 'unread', 'tag:unread' ],
\r
77 \ [ 'to-do', 'tag:to-do' ],
\r
78 \ [ 'to-me', 'to:john.doe and tag:new' ],
\r
80 diff --git a/vim/notmuch.vim b/vim/notmuch.vim
\r
81 index 331e930..61a7260 100644
\r
82 --- a/vim/notmuch.vim
\r
83 +++ b/vim/notmuch.vim
\r
84 @@ -374,7 +374,9 @@ function! s:folders_show_search()
\r
86 n = $curbuf.line_number
\r
87 s = $searches[n - 1]
\r
88 - VIM::command("call s:search('#{s}')")
\r
90 + VIM::command("call s:search('#{s}')")
\r
95 @@ -633,11 +635,21 @@ ruby << EOF
\r
96 folders = VIM::evaluate('g:notmuch_folders')
\r
97 count_threads = VIM::evaluate('g:notmuch_folders_count_threads') == 1
\r
100 + folders.each do |name, search|
\r
101 + if name.length > longest_name
\r
102 + longest_name = name.length
\r
105 folders.each do |name, search|
\r
106 q = $curbuf.query(search)
\r
107 $searches << search
\r
108 count = count_threads ? q.search_threads.count : q.search_messages.count
\r
109 - b << "%9d %-20s (%s)" % [count, name, search]
\r
113 + b << "%9d %-#{longest_name + 1}s (%s)" % [count, name, search]
\r
118 diff --git a/vim/syntax/notmuch-folders.vim b/vim/syntax/notmuch-folders.vim
\r
119 index 9477f86..03209c1 100644
\r
120 --- a/vim/syntax/notmuch-folders.vim
\r
121 +++ b/vim/syntax/notmuch-folders.vim
\r
123 " notmuch folders mode syntax file
\r
125 syntax region nmFoldersCount start='^' end='\%10v'
\r
126 -syntax region nmFoldersName start='\%11v' end='\%31v'
\r
127 +syntax region nmFoldersName start='\%11v' end=' ('me=e-1
\r
128 syntax match nmFoldersSearch /([^()]\+)$/
\r
130 highlight link nmFoldersCount Statement
\r