mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
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
This commit is contained in:
parent
e0ce86119c
commit
4a1ccfedd9
1 changed files with 11 additions and 2 deletions
|
@ -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_reader_default = 'mutt -f %s'
|
||||||
let s:notmuch_sendmail_default = 'sendmail'
|
let s:notmuch_sendmail_default = 'sendmail'
|
||||||
let s:notmuch_folders_count_threads_default = 0
|
let s:notmuch_folders_count_threads_default = 0
|
||||||
|
let s:notmuch_compose_start_insert_default = 1
|
||||||
|
|
||||||
function! s:new_file_buffer(type, fname)
|
function! s:new_file_buffer(type, fname)
|
||||||
exec printf('edit %s', a:fname)
|
exec printf('edit %s', a:fname)
|
||||||
|
@ -132,7 +133,9 @@ function! s:show_reply()
|
||||||
let b:compose_done = 0
|
let b:compose_done = 0
|
||||||
call s:set_map(g:notmuch_compose_maps)
|
call s:set_map(g:notmuch_compose_maps)
|
||||||
autocmd BufDelete <buffer> call s:on_compose_delete()
|
autocmd BufDelete <buffer> call s:on_compose_delete()
|
||||||
startinsert!
|
if g:notmuch_compose_start_insert
|
||||||
|
startinsert!
|
||||||
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:compose()
|
function! s:compose()
|
||||||
|
@ -140,7 +143,9 @@ function! s:compose()
|
||||||
let b:compose_done = 0
|
let b:compose_done = 0
|
||||||
call s:set_map(g:notmuch_compose_maps)
|
call s:set_map(g:notmuch_compose_maps)
|
||||||
autocmd BufDelete <buffer> call s:on_compose_delete()
|
autocmd BufDelete <buffer> call s:on_compose_delete()
|
||||||
startinsert!
|
if g:notmuch_compose_start_insert
|
||||||
|
startinsert!
|
||||||
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:show_info()
|
function! s:show_info()
|
||||||
|
@ -428,6 +433,10 @@ function! s:set_defaults()
|
||||||
endif
|
endif
|
||||||
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')
|
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
|
let g:notmuch_custom_search_maps = g:notmuch_rb_custom_search_maps
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue