Attilio Attilio - 2 months ago 27
Git Question

Configure git commit editor colors

What is the parameter to configure the color of the first line (and the body text) of the commit message editor of git? (In case that matters, I am using vim as an editor).

I have found many related resources, but none of them gave the option to specify this color.
(For the records, the most relevant hits were the following:



I am beginning to suspect that this option has to be configured somewhere else (e.g. in bash or in vim)...

Answer

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