0

What can I do to have proper highlighting on a .git file? I chose Vim as my default editor when I commit files, the color scheme(Gruvbox) is applied, but I get strange colors as I start typing.

I wanted to have the delimiter on the recommended number of characters to write before changing to a new line as well. It seems like I only get it for the first line. Afterwards I get this strange highlighted text.

enter image description here

5

Your Vim setup is actually behaving correctly, here.

Git commit messages are recommended always to have a blank line after the first line. The strange colouring you're seeing is highlighting this as an error so you can fix it.

The recommended line limit for the first line is smaller than the limit for later lines (because the first line is often pushed off to the right by commit IDs. etc.)

Therefore, your config has set up hard-wrapping using 'textwidth' for the later lines, and the colouring to indicate when you've reached the recommended limit for the first line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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