unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] vim: add per-message tagging
Date: Tue,  9 May 2023 10:18:31 -0600	[thread overview]
Message-ID: <20230509161831.1793709-1-felipe.contreras@gmail.com> (raw)

Also map space to mark a message as read and archived.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---

I forced myself to use the version of notmuch-vim in notmuch and while
it works, this is the single most important feature I missed the most.

 vim/notmuch.vim | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index c1c2f63d..dc4f6242 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -40,6 +40,7 @@ let g:notmuch_show_maps = {
 	\ 'r':		'show_reply()',
 	\ '?':		'show_info()',
 	\ '<Tab>':	'show_next_msg()',
+	\ '<Space>':	'show_message_tag("-inbox -unread")',
 	\ 'c':		'compose()',
 	\ }
 
@@ -206,6 +207,16 @@ function! s:show_tag(intags)
 	call s:show_next_thread()
 endfunction
 
+function! s:show_message_tag(intags)
+	if empty(a:intags)
+		let tags = input('tags: ')
+	else
+		let tags = a:intags
+	endif
+	ruby do_tag('id:' + get_message.message_id, VIM::evaluate('l:tags'))
+  call s:show_next_msg()
+endfunction
+
 function! s:search_search_prompt()
 	let text = input('Search: ')
 	if text == ""
-- 
2.40.0+fc1

             reply	other threads:[~2023-05-09 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 16:18 Felipe Contreras [this message]
2023-05-25 10:18 ` [PATCH] vim: add per-message tagging David Bremner

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=20230509161831.1793709-1-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --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).