How to start Vim in insert mode at end of first line when committing Git changes?
Adapting one of the autocommands given in the Vim Wikia, this seems to work fine with git commit -t /tmp/COMMIT_EDITMSG
for me:
" ~/.vim/ftplugin/gitcommit.vim
au! VimEnter COMMIT_EDITMSG exec 'norm gg' | startinsert!
I used exec 'norm gg' |
instead 1 |
because :1 |
is equivalent to :1p |
and there's a small delay as the line is printed.