I'm using vim-fugitive. However, I'm using a black and white colorscheme. So, I don't see any warning for the 50 char long subject line of git commit message. I want to know how I can add a highlight group for that setting.

Is there any existing highlight group like 'Statement' or 'Special' for this setting? Or do I need to create one myself? If yes, then how do I do it?

1 Answer 1


The highlight group is hi gitcommitOverflow. however it's part of vim's built-in syntax file gitcommit.vim, not in any way part of fugitive (besides having the same maintainer).

Strangely, it looks like it was intended to be linked to Error by default but this was commented out.

"hi def link gitcommitOverflow      Error

Putting this line in your custom color scheme/syntax configuration would work, or you can assign different colors in the usual way.

In the future, if you want to see which highlight group is being used you can use a map such as this (from vim tip 99 and How to identify the highlight groups in use on a particular character?):

map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
    \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
    \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.