summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorIan Main <imain@stemwinder.org>2014-10-01 10:11:28 -0700
committerDavid Bremner <david@tethera.net>2014-10-21 10:24:52 +0200
commit4a1ccfedd99de3571d2630dc277ef5b80f9061f7 (patch)
treeadf87aa3ce28e262b946a2c380551323ee331900 /vim
parente0ce86119cbae520728c6812c021315a885f52ce (diff)
VIM: Make starting in 'insert' mode for compose optional
This adds a variable to make starting in insert mode optional when composing and replying to emails. I found it unusual to be started in insert mode so I thought I'd make it optional as others may find this as well. Ian
Diffstat (limited to 'vim')
-rw-r--r--vim/notmuch.vim13
1 files changed, 11 insertions, 2 deletions
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index b251af6e..cad95178 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -59,6 +59,7 @@ let s:notmuch_datetime_format_default = '%d.%m.%y %H:%M:%S'
let s:notmuch_reader_default = 'mutt -f %s'
let s:notmuch_sendmail_default = 'sendmail'
let s:notmuch_folders_count_threads_default = 0
+let s:notmuch_compose_start_insert_default = 1
function! s:new_file_buffer(type, fname)
exec printf('edit %s', a:fname)
@@ -132,7 +133,9 @@ function! s:show_reply()
let b:compose_done = 0
call s:set_map(g:notmuch_compose_maps)
autocmd BufDelete <buffer> call s:on_compose_delete()
- startinsert!
+ if g:notmuch_compose_start_insert
+ startinsert!
+ end
endfunction
function! s:compose()
@@ -140,7 +143,9 @@ function! s:compose()
let b:compose_done = 0
call s:set_map(g:notmuch_compose_maps)
autocmd BufDelete <buffer> call s:on_compose_delete()
- startinsert!
+ if g:notmuch_compose_start_insert
+ startinsert!
+ end
endfunction
function! s:show_info()
@@ -428,6 +433,10 @@ function! s:set_defaults()
endif
endif
+ if !exists('g:notmuch_compose_start_insert')
+ let g:notmuch_compose_start_insert = s:notmuch_compose_start_insert_default
+ endif
+
if !exists('g:notmuch_custom_search_maps') && exists('g:notmuch_rb_custom_search_maps')
let g:notmuch_custom_search_maps = g:notmuch_rb_custom_search_maps
endif