Configure git commit editor colors

To change the color of the title when you are editing the commit message in vim, add following code to ~/.vimrc

au FileType gitcommit
 \ hi gitcommitSummary ctermfg=yellow ctermbg=red

other highlight option can be found by typing :hi in vim command, or from following url

https://github.com/vim/vim/blob/master/runtime/syntax/gitcommit.vim


As the syntax script for the gitcommit filetype properly uses :hi def link, you can simply overwrite any of its highlightings in your ~/.vimrc:

:hi gitcommitSummary ctermfg=yellow ctermbg=red

No :au FileType gitcommit (as in @ymonad's answer) is necessary.


What I was missing was a GIT_EDITOR environment variable. (Can also be set as core.editor in git config.) When I set that to /usr/bin/vim, the colors showed up in my commit editor session.

Tags:

Vim

Git