summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-29 21:44:18 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 21:47:38 -0400
commitb1ee510d05d37c835e4e8478f5eb1c787bb7d17f (patch)
treef27f1d2e6ac73f68ce1b704bd827477c8056e29e /vim
parent21db1a0143359b6277ffb18f0b79e90ea133a43e (diff)
downloadconf-b1ee510d05d37c835e4e8478f5eb1c787bb7d17f.tar.gz
conf-b1ee510d05d37c835e4e8478f5eb1c787bb7d17f.zip
only go into insert mode for empty gitcommit buffers
Diffstat (limited to 'vim')
-rw-r--r--vim/ftplugin/gitcommit.vim6
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