From b1ee510d05d37c835e4e8478f5eb1c787bb7d17f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 29 Oct 2017 21:44:18 -0400 Subject: only go into insert mode for empty gitcommit buffers --- vim/ftplugin/gitcommit.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vim') diff --git a/vim/ftplugin/gitcommit.vim b/vim/ftplugin/gitcommit.vim index 4c25752..b1c1450 100644 --- a/vim/ftplugin/gitcommit.vim +++ b/vim/ftplugin/gitcommit.vim @@ -1,5 +1,9 @@ setlocal viminfo= augroup local_gitcommit autocmd! - autocmd BufWinEnter exe "normal! ggO" | startinsert + autocmd BufWinEnter + \ if getline(1) == '' | + \ exe "normal! ggO" | + \ startinsert | + \ endif augroup END -- cgit v1.2.3-54-g00ecf