Last Updated: February 25, 2016
·
362
· kayaalpg

Highligt fixes/closes/resolves and other variations in commit messages

This piece of stupid vimscript will highlight pieces of commit message that will close github issues, and also what I regard as tags: [vim], or [scsi] etc...

I couldn't get it to work with ft=gitcommit, I'd love to learn how I can if possible.

au BufEnter COMMIT_EDITMSG
  \ setf txt |
  \ syntax match githubIssueSyntax 
  \ /\([Ff]ix\(e[sd]\)\?\|[Cc]lose[sd]\?\|[Rr]esolve[sd]\?\) #[0-9]\+/ |
  \ highlight githubIssueSyntax ctermfg=red |
  \ syntax match gitcommitTag /\[\w\+\]/ |
  \ highlight gitcommitTag ctermfg=213

Picture