X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=vim%2Fplugin%2Fnotmuch.vim;h=3c9c3162aa6a33c00725a6f298c8883df83d03de;hb=aa312db8cd333d3739011e2299905542c9031946;hp=d3e313533060fca8728d899083a7ed7d0fc046b9;hpb=b078a0c8c2ce72e1273bed87627e25dcd833a967;p=notmuch diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index d3e31353..3c9c3162 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -53,6 +53,8 @@ let s:notmuch_defaults = { \ \ 'g:notmuch_show_citation_regexp': '^\s*>' , \ + \ 'g:notmuch_compose_insert_mode_start': 1 , + \ 'g:notmuch_compose_header_help': 1 , \ 'g:notmuch_compose_temp_file_dir': '~/.notmuch/compose/' , \ } @@ -161,6 +163,7 @@ let g:notmuch_show_maps = { " --- --- bindings for compose screen {{{2 let g:notmuch_compose_nmaps = { \ ',s': ':call NM_compose_send()', + \ ',a': ':call NM_compose_attach()', \ ',q': ':call NM_kill_this_buffer()', \ '': ':call NM_compose_next_entry_area()', \ } @@ -875,7 +878,13 @@ endfunction " --- implement compose screen {{{1 function! s:NM_cmd_compose(words, body_lines) - let lines = [] + let lines = !g:notmuch_compose_header_help ? [] : [ + \ 'Notmuch-Help: Type in your message here; to help you use these bindings:', + \ 'Notmuch-Help: ,a - attach a file', + \ 'Notmuch-Help: ,s - send the message (Notmuch-Help lines will be removed)', + \ 'Notmuch-Help: ,q - abort the message', + \ 'Notmuch-Help: - skip through header lines', + \ ] let start_on_line = 0 let hdrs = { } @@ -931,22 +940,24 @@ function! s:NM_cmd_compose(words, body_lines) \ 'compose', lines) setlocal bufhidden=hide - call NM_cmd_compose_mksyntax() call NM_set_map('n', g:notmuch_compose_nmaps) call NM_set_map('i', g:notmuch_compose_imaps) - exec printf('norm %dG', start_on_line) - startinsert! + call cursor(start_on_line, strlen(start_on_line) + 1) + if g:notmuch_compose_insert_mode_start + startinsert! + endif echo 'Type your message, use to jump to next header and then body.' endfunction -function! s:NM_cmd_compose_mksyntax() - silent! setlocal syntax=mail -endfunction function! s:NM_compose_send() echo 'not implemented' endfunction +function! s:NM_compose_attach() + echo 'not implemented' +endfunction + function! s:NM_compose_next_entry_area() let lnum = line('.') let hdr_end = NM_compose_find_line_match(1,'^$',1) @@ -968,7 +979,6 @@ function! s:NM_compose_next_entry_area() call cursor(lnum+1, strlen(getline(lnum+1)) + 1) return '' endif - echo 'mode=' . mode() if mode() == 'i' if !getbufvar(bufnr('.'), '&et') return "\t"