git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: Re: [PATCH] git-status: colorize status output
Date: Fri, 4 Aug 2006 23:21:35 -0400	[thread overview]
Message-ID: <20060805032135.GA11244@coredump.intra.peff.net> (raw)
In-Reply-To: <20060805031418.GA11102@coredump.intra.peff.net>

On Fri, Aug 04, 2006 at 11:14:19PM -0400, Jeff King wrote:

> The idea is that red things indicate a potential mistake on the part of the
> user (e.g., forgetting to update a file, forgetting to git-add a file).

I actually wanted to do this because I started syntax-highlighting the
git-commit message in vim. I found myself catching simple mistakes in
commits, like the ones I mentioned above, before committing, saving me
from doing an --amend. Then I got so hooked on it I wanted the
colorization everytime I ran git-status.

If anyone is interested in the vim syntax highlighting, it is below.
Copy the file to $HOME/.vim/syntax/gitcommit.vim and add the following
line to your .vimrc:
  autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit

-Peff

-- >8 --
syn region gitLine start=/^#/ end=/$/
syn region gitCommit start=/^# Updated but not checked in:$/ end=/^#$/ contains=gitHead,gitCommitFile
syn region gitHead contained start=/^#   (.*)/ end=/^#$/
syn region gitChanged start=/^# Changed but not updated:/ end=/^#$/ contains=gitHead,gitChangedFile
syn region gitUntracked start=/^# Untracked files:/ end=/^#$/ contains=gitHead,gitUntrackedFile

syn match gitCommitFile contained /^#\t.*/hs=s+2
syn match gitChangedFile contained /^#\t.*/hs=s+2
syn match gitUntrackedFile contained /^#\t.*/hs=s+2

hi def link gitLine Comment
hi def link gitCommit Comment
hi def link gitChanged Comment
hi def link gitHead Comment
hi def link gitUntracked Comment
hi def link gitCommitFile Type
hi def link gitChangedFile Constant
hi def link gitUntrackedFile Constant

  reply	other threads:[~2006-08-05  3:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-05  3:14 [PATCH] git-status: colorize status output Jeff King
2006-08-05  3:21 ` Jeff King [this message]
2006-08-05  8:16   ` Greg KH
2006-08-05  9:28 ` Junio C Hamano
2006-08-05 10:21   ` Jeff King
2006-08-05 10:44     ` Jeff King
2006-08-05 10:59 ` Matthias Lederhofer
2006-08-05 11:21   ` Junio C Hamano
2006-08-05 11:27     ` Junio C Hamano
2006-08-05 11:28     ` Matthias Lederhofer
2006-08-05 11:42       ` Junio C Hamano
2006-08-05 12:18         ` Matthias Lederhofer
2006-08-05 19:54           ` Jeff King
2006-08-05 20:31             ` Matthias Lederhofer
2006-08-05 19:51         ` Jeff King
2006-08-07 17:12         ` Sam Ravnborg
2006-08-05 19:45   ` Jeff King
2006-08-05 20:27     ` Matthias Lederhofer
2006-08-05 23:42       ` Jeff King
2006-08-06  5:01 ` Joel Becker
2006-08-06  6:16   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060805032135.GA11244@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).