Entering insert mode automatically when editing git commit messages
If I do a
git commit, when Vim opens, I want to be in insert mode straight away.
I noticed that the
filetype is set to
gitcommit when editing, so I thought I could achieve this with an autocommand.
au BufRead gitcommit startinsert!
This doesn’t work though, what am I doing wrong?
I settled on
au FileType gitcommit execute "normal! O" | startinsert to add a new line above the current and then enter insert mode ready for entering a message.