Your question is a bit unclear whether you want to enable this behavior on your machine or change it. Since Vivian already explained how to override filetype settings, I'm going to talk about the other things.
The syntax highlighting and textwidth
are set in two files called gitcommit.vim
. One is located in $VIMRUNTIME/syntax
, the other one in $VIMRUNTIME/ftplugin
. These files come with Vim.
To set the filetype for the current buffer, write set filetype=gitcommit
.
To have automatic filetype detection, put :filetype plugin on
in your vimrc
.
As always, refer to :help
for the options mentioned above.
It's also possible to define new filetypes or define aliases. I once did this to apply git syntax highlighting to svn commit messages (not perfect but better than nothing).
syntax on
.