Entering insert mode automatically when editing git commit messages

前端 未结 3 2196
难免孤独
难免孤独 2021-02-19 01:37

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 w

3条回答
  •  臣服心动
    2021-02-19 02:23

    This is probably a bit more complex than it needs to be, but you can do this with an individual filetype plugin:

    $ mkdir -p ~/.vim/ftplugin/gitcommit
    $ echo 'startinsert!' > !$/git-commit-insert.vim
    

提交回复
热议问题