unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] VIM: Make starting in 'insert' mode for compose optional
@ 2014-10-01 17:11 Ian Main
  2014-10-18 20:37 ` Franz Fellner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ian Main @ 2014-10-01 17:11 UTC (permalink / raw)
  To: notmuch

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
---
 vim/notmuch.vim | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 331e930..252f16b 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
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] VIM: Make starting in 'insert' mode for compose optional
  2014-10-01 17:11 [PATCH] VIM: Make starting in 'insert' mode for compose optional Ian Main
@ 2014-10-18 20:37 ` Franz Fellner
  2014-10-19  9:42 ` Tomi Ollila
  2014-10-21  8:31 ` David Bremner
  2 siblings, 0 replies; 4+ messages in thread
From: Franz Fellner @ 2014-10-18 20:37 UTC (permalink / raw)
  To: Ian Main, Ian Main, notmuch

Ian Main wrote:
> I found it unusual to be started in insert mode
Me too.
Patch LGTM. Works as expected - thx!

Franz
> 
>     Ian
> ---
>  vim/notmuch.vim | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/vim/notmuch.vim b/vim/notmuch.vim
> index 331e930..252f16b 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
> -- 
> 1.9.3
> 
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] VIM: Make starting in 'insert' mode for compose optional
  2014-10-01 17:11 [PATCH] VIM: Make starting in 'insert' mode for compose optional Ian Main
  2014-10-18 20:37 ` Franz Fellner
@ 2014-10-19  9:42 ` Tomi Ollila
  2014-10-21  8:31 ` David Bremner
  2 siblings, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2014-10-19  9:42 UTC (permalink / raw)
  To: Ian Main, notmuch

On Wed, Oct 01 2014, Ian Main <imain@stemwinder.org> wrote:

> 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.

Looks "Trivial" enough to look Good To Me (and patch apply)

>
>     Ian
> ---
>  vim/notmuch.vim | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/vim/notmuch.vim b/vim/notmuch.vim
> index 331e930..252f16b 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
> -- 
> 1.9.3
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] VIM: Make starting in 'insert' mode for compose optional
  2014-10-01 17:11 [PATCH] VIM: Make starting in 'insert' mode for compose optional Ian Main
  2014-10-18 20:37 ` Franz Fellner
  2014-10-19  9:42 ` Tomi Ollila
@ 2014-10-21  8:31 ` David Bremner
  2 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2014-10-21  8:31 UTC (permalink / raw)
  To: Ian Main, notmuch

Ian Main <imain@stemwinder.org> writes:

> 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.

pushed,

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-21  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-01 17:11 [PATCH] VIM: Make starting in 'insert' mode for compose optional Ian Main
2014-10-18 20:37 ` Franz Fellner
2014-10-19  9:42 ` Tomi Ollila
2014-10-21  8:31 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).