Skip to content

Instantly share code, notes, and snippets.

@ob-ivan
Forked from keithamus/Nano Git Commit Syntax highlighting
Last active April 28, 2021 08:51
Show Gist options
  • Save ob-ivan/4470622183396c819251380a864c7309 to your computer and use it in GitHub Desktop.
Save ob-ivan/4470622183396c819251380a864c7309 to your computer and use it in GitHub Desktop.
Include this file from 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!
syntax "gitcommit" "COMMIT_EDITMSG$"
color cyan "#.*"
color brightgreen "# On branch .*"
color cyan "# On branch"
color green "#.(new file|modified|deleted).*"
color yellow start="# Changes.*" end="# Changed.*"
color red start="# Untracked.*" end="diff"
color red start="# Untracked.*" end="$$"
color brightred "^deleted file mode .*"
color brightgreen "^new file mode .*"
color red "^-.*"
color green "^\+.*"
color brightyellow "^(diff|index|---|\+\+\+).*"
color brightmagenta "@@.*@@"
color cyan "# (Change[ds]|Untracked) .*"
color cyan "#.*\(use .*"
color brightcyan "# -* >8 -*"
color cyan "^#"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment