Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git Commit nanorc file with diff/patch support
# Some parts from here : http://milianw.de/code-snippets/git-commit-message-highlighting-in-nano
# Some parts from here : https://github.com/serialhex/nano-highlight/blob/master/patch.nanorc
# syntax highlighting for git commit messages
syntax "patch" ".git/COMMIT_EDITMSG$"
# overlong lines
# color brightred "^.{70,}.+$"
# comment
color blue "^#.*$"
# special comment lines
color green "^# Changes to be committed:"
color red "^# Changes not staged for commit:"
color brightblue "^# Untracked files:"
color brightblue "^# On branch .+$"
color brightblue "^# Your branch is ahead of .+$"
# diff files
color cyan "^#[^ a-zA-Z0-9][^ ].*$"
color brightgreen "^\+.*"
color green "^\+\+\+.*"
color brightred "^-.*"
color red "^---.*"
color brightyellow "^@@.*"
color magenta "^diff.*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment