\ '<Enter>': 'folders_show_search()',
\ 's': 'folders_search_prompt()',
\ '=': 'folders_refresh()',
+ \ 'c': 'compose()',
\ }
let g:notmuch_rb_search_maps = {
\ 's': 'search_search_prompt()',
\ '=': 'search_refresh()',
\ '?': 'search_info()',
+ \ 'c': 'compose()',
\ }
let g:notmuch_rb_show_maps = {
\ 'r': 'show_reply()',
\ '?': 'show_info()',
\ '<Tab>': 'show_next_msg()',
+ \ 'c': 'compose()',
\ }
let g:notmuch_rb_compose_maps = {
startinsert!
endfunction
+function! s:compose()
+ ruby open_compose
+ let b:compose_done = 0
+ call s:set_map(g:notmuch_rb_compose_maps)
+ autocmd BufUnload <buffer> call s:compose_unload()
+ startinsert!
+endfunction
+
function! s:show_info()
ruby vim_puts get_message.inspect
endfunction
open_compose_helper(lines, cur)
end
+ def open_compose()
+ lines = []
+
+ lines << "Date: #{Time.now().strftime('%a, %-d %b %Y %T %z')}"
+ lines << "From: #{$email}"
+ lines << "To: "
+ cur = lines.count
+
+ lines << "Cc: "
+ lines << "Bcc: "
+ lines << "Message-Id: #{generate_message_id}"
+ lines << "Subject: "
+ lines << "Mime-Version: 1.0"
+ lines << "Content-Type: text/plain; charset=utf-8"
+ lines << "Content-Transfer-Encoding: 7bit"
+ lines << ""
+ lines << ""
+ lines << ""
+
+ open_compose_helper(lines, cur)
+ end
+
def folders_render()
$curbuf.render do |b|
folders = VIM::evaluate('g:notmuch_rb_folders')