diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-10-29 21:44:18 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-10-29 21:47:38 -0400 |
commit | b1ee510d05d37c835e4e8478f5eb1c787bb7d17f (patch) | |
tree | f27f1d2e6ac73f68ce1b704bd827477c8056e29e /vim/ftplugin | |
parent | 21db1a0143359b6277ffb18f0b79e90ea133a43e (diff) | |
download | conf-b1ee510d05d37c835e4e8478f5eb1c787bb7d17f.tar.gz conf-b1ee510d05d37c835e4e8478f5eb1c787bb7d17f.zip |
only go into insert mode for empty gitcommit buffers
Diffstat (limited to 'vim/ftplugin')
-rw-r--r-- | vim/ftplugin/gitcommit.vim | 6 |
1 files changed, 5 insertions, 1 deletions
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 <buffer> exe "normal! ggO" | startinsert + autocmd BufWinEnter <buffer> + \ if getline(1) == '' | + \ exe "normal! ggO" | + \ startinsert | + \ endif augroup END |