unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] vim: add per-message tagging
@ 2023-05-09 16:18 Felipe Contreras
  2023-05-25 10:18 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: Felipe Contreras @ 2023-05-09 16:18 UTC (permalink / raw)
  To: notmuch

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

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

* Re: [PATCH] vim: add per-message tagging
  2023-05-09 16:18 [PATCH] vim: add per-message tagging Felipe Contreras
@ 2023-05-25 10:18 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2023-05-25 10:18 UTC (permalink / raw)
  To: Felipe Contreras, notmuch

Felipe Contreras <felipe.contreras@gmail.com> writes:

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

Is this a change that would make sense by itself? If so I think it would
be better as a separate commit, especially since I use "git shortlog" to
make up release notes.


> +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
> +

As we discussed, I can't meaningfully review the vimscript parts (and
nobody else seems interested / willing). I've (re?)  enabled push access
for you at

        git@git.notmuchmail.org:notmuch

For now the access is to everything under vim/. We can discuss direct
access for the ruby bindings later.  It's the first time I've used this
feature of gitolite, so if you can't get it to work let me know, either
by email or (perhaps more efficiently) by IRC on
irc://irc.libera.chat/notmuch

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

end of thread, other threads:[~2023-05-25 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09 16:18 [PATCH] vim: add per-message tagging Felipe Contreras
2023-05-25 10:18 ` David Bremner

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