unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] VIM v2: Add a 'tag all' folder option.
@ 2014-10-02  0:02 Ian Main
  2014-10-24  7:14 ` Ian Main
  2014-11-15  8:54 ` David Bremner
  0 siblings, 2 replies; 4+ messages in thread
From: Ian Main @ 2014-10-02  0:02 UTC (permalink / raw)
  To: notmuch

This adds the ability to mark an entire folder as read (or any other
tags you like once you map it).

This update adds documentation for the command.

    Ian
---
 vim/notmuch.txt |  1 +
 vim/notmuch.vim | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/vim/notmuch.txt b/vim/notmuch.txt
index 4374102..33cbe6e 100644
--- a/vim/notmuch.txt
+++ b/vim/notmuch.txt
@@ -47,6 +47,7 @@ MAPPINGS					*notmuch-mappings*
 Folder view~
 
 <enter>	Show selected search
+A	Archive (-inbox -unread) an entire folder
 s	Enter a new search
 =	Refresh
 c	Compose a new mail
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 331e930..3f2444b 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -11,6 +11,7 @@ let g:loaded_notmuch = "yep"
 let g:notmuch_folders_maps = {
 	\ '<Enter>':	'folders_show_search()',
 	\ 's':		'folders_search_prompt()',
+	\ 'A':		'folders_tag_all("-inbox -unread")',
 	\ '=':		'folders_refresh()',
 	\ 'c':		'compose()',
 	\ }
@@ -378,6 +379,16 @@ ruby << EOF
 EOF
 endfunction
 
+function! s:folders_tag_all(tags)
+ruby << EOF
+	n = $curbuf.line_number
+	s = $searches[n - 1]
+	t = VIM::evaluate('a:tags')
+	do_tag(s, t)
+EOF
+	call s:folders_refresh()
+endfunction
+
 function! s:folders()
 	call s:new_buffer('folders')
 	ruby folders_render()
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-15 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02  0:02 [PATCH] VIM v2: Add a 'tag all' folder option Ian Main
2014-10-24  7:14 ` Ian Main
2014-11-15  8:54 ` David Bremner
2014-11-15 13:35   ` Tomi Ollila

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).