I ran git config --global alias.ci commit --verbose
This makes it so running git ci
is like running git commit --verbose
The --verbose
flag shows a diff in the commit message template, which is not commented so syntax highlighting works on it, but is automatically recognized to not actually be submitted into the repository's log. Can, of course, be very long, but can be useful for creating better commit comments. (And, if you don't need it, you can just ignore it.)
Anyways, if I run git diff
, lines that are removed (start with '-') are in red, and lines that are added (start with '+') are in green.
If I run git ci
, vim syntax highlights lines that are removed as regular color (white), and lines that are added as cyan.
How can I make vim syntax highlight show removed lines in red and addes ones in green?
The vim status line says it's editing file "~/code.git/.git/COMMIT_EDITMSG". I don't know much about vim syntax highlighting, but I know it's configurable. I'm not sure how this situation would be configurable, because I assume vim uses file extensions in deciding which syntax highlighting rules to follow (I could be way off here) and git isn't giving this file an extension.
EDIT: Actually, vim must be detecting this is a git commit file, because it's syntax highlighting the first 50 characters as yellow. Assuming that's to indicate what can nicely fit on an emailed subject line for a patch.
git diff
the -/+ were not red/green. thisi is what i was looking for:git config --global color.ui auto
. after setting the configuration,git diff
is now the same asgiit diff --color