Created
December 10, 2010 13:58
-
-
Save keithamus/736220 to your computer and use it in GitHub Desktop.
Add this to your ~/.nanorc and when running "git commit" (if your editor is nano) you'll have syntax highlighting in your commit message. Includes support for "git commit -v" too!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax "gitcommit" "COMMIT_EDITMSG$" | |
color white "#.*" | |
color green "#.(modified|added|deleted|unmerged|copy-edit|rename).*" | |
color yellow start="# Changes.*" end="# Changed.*" | |
color brightgreen "^\+.*" | |
color brightred "^-.*" | |
color brightyellow "(diff|index|---|\+\+\+).*" | |
color brightmagenta "@@.*" | |
color white "# Changes .*" | |
color white "# Changed .*" | |
color white "#.*\(use .*" | |
color white "#$" |
Legend cheers mate
Will this work for .vimrc as well?
Thanks <3
Great highlighting! My life has just become so much better!
Some ideas to add to this:
- Put this into a separate file (I use
.config/nano/gitcommit.nanorc
) and then reference to it from your.nanorc
with aninclude
line as described here: http://milianw.de/code-snippets/git-commit-message-highlighting-in-nano - Use different colors for comments and the message itself. E.g.
cyan
for the comments. - Special highlighting for the "cut" line with
---- >8 ----
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great!! thanks man