]> git.notmuchmail.org Git - notmuch/blobdiff - vim/plugin/notmuch.vim
fix sum moar typos [error messages]
[notmuch] / vim / plugin / notmuch.vim
index fca48568921c6d8a1965593e22302d5de28db443..768a011cf7bc959b9057e2a34b0b31d578e88c64 100644 (file)
@@ -123,6 +123,7 @@ let g:notmuch_search_maps = {
         \ 'I':          ':call <SID>NM_search_mark_read_thread()<CR>',
         \ 'a':          ':call <SID>NM_search_archive_thread()<CR>',
         \ 'A':          ':call <SID>NM_search_mark_read_then_archive_thread()<CR>',
+        \ 'D':          ':call <SID>NM_search_delete_thread()<CR>',
         \ 'f':          ':call <SID>NM_search_filter()<CR>',
         \ 'm':          ':call <SID>NM_new_mail()<CR>',
         \ 'o':          ':call <SID>NM_search_toggle_order()<CR>',
@@ -153,6 +154,8 @@ let g:notmuch_show_maps = {
         \ 'I':          ':call <SID>NM_show_mark_read_thread()<CR>',
         \ 'a':          ':call <SID>NM_show_archive_thread()<CR>',
         \ 'A':          ':call <SID>NM_show_mark_read_then_archive_thread()<CR>',
+        \ 'D':          ':call <SID>NM_show_delete_thread()<CR>',
+        \ 'd':          ':call <SID>NM_show_delete_message()<CR>',
         \ 'N':          ':call <SID>NM_show_mark_read_then_next_open_message()<CR>',
         \ 'v':          ':call <SID>NM_show_view_all_mime_parts()<CR>',
         \ '+':          ':call <SID>NM_show_add_tag()<CR>',
@@ -326,6 +329,11 @@ function! s:NM_search_mark_read_then_archive_thread()
         norm j
 endfunction
 
+function! s:NM_search_delete_thread()
+        call <SID>NM_tag([], ['+delete','-inbox','-unread'])
+        norm j
+endfunction
+
 function! s:NM_search_filter()
         call <SID>NM_search_filter_helper('Filter: ', '', '')
 endfunction
@@ -518,6 +526,16 @@ function! s:NM_show_mark_read_then_archive_thread()
         call <SID>NM_show_next_thread()
 endfunction
 
+function! s:NM_show_delete_thread()
+        call <SID>NM_tag(b:nm_search_words, ['+delete', '-inbox', '-unread'])
+        call <SID>NM_show_next_thread()
+endfunction
+
+function! s:NM_show_delete_message()
+        let msg = <SID>NM_show_get_message_for_line(line('.'))
+        call <SID>NM_tag([msg['id']], ['+delete', '-inbox', '-unread'])
+endfunction
+
 function! s:NM_show_mark_read_then_next_open_message()
         echo 'not implemented'
 endfunction
@@ -747,7 +765,7 @@ function! s:NM_cmd_show_parse(inlines)
 
                         if part_end
                                 " FIXME: this is a hack for handling two folds being added for one line
-                                "         we should handle addinga fold in a function
+                                "         we should handle adding a fold in a function
                                 if len(foldinfo) && foldinfo[1] < foldinfo[2]
                                         call add(info['folds'], foldinfo[0:3])
                                         let info['foldtext'][foldinfo[1]] = foldinfo[4]
@@ -1296,7 +1314,7 @@ endfunction
 function! s:NM_tag(filter, tags)
         let filter = len(a:filter) ? a:filter : [<SID>NM_search_thread_id()]
         if !len(filter)
-                throw 'Eeek! I couldn''t find the thead id!'
+                throw 'Eeek! I couldn''t find the thread id!'
         endif
         let args = ['tag']
         call extend(args, a:tags)