git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Manlio Perillo <manlio.perillo@gmail.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: about vim contrib support
Date: Thu, 10 Jan 2013 08:36:19 -0500	[thread overview]
Message-ID: <20130110133619.GA19232@sigill.intra.peff.net> (raw)
In-Reply-To: <50EEAB36.6060508@gmail.com>

On Thu, Jan 10, 2013 at 12:51:18PM +0100, Manlio Perillo wrote:

> .patch files are handled by diff highlight.
> What I would like to do is to use gitcommit syntax highlight, in order
> to also enable commit subject message hightlight.

Using the regular gitcommit highlighter would not make sense, as it is
intended for the message templates seen when making a commit. Whereas
format-patch .patch files have the headers as email headers.

You can load the mail header highlighting on top of diff highlighting
like this (which only triggers for patches that look like emails):

  au FileType diff
    \ if getline(1) =~ '^From ' |
    \   unlet b:current_syntax |
    \   runtime! syntax/mail.vim |
    \ endif

But maybe there is something else that you wanted to highlight. It's not
clear to me what you want from gitcommit's highlighting. Is it the
"complain about long lines" highlighting? I think that you'd have to
pull out of the gitcommit.vim and execute manually (and you'd have to
tweak the regex to take into account the "Subject: [PATCH] bits).

-Peff

  reply	other threads:[~2013-01-10 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 11:17 about vim contrib support Manlio Perillo
2013-01-10 11:39 ` Jeff King
2013-01-10 11:51   ` Manlio Perillo
2013-01-10 13:36     ` Jeff King [this message]
2013-01-10 20:54   ` [PATCH] contrib/vim: simplify instructions for old vim support Jonathan Nieder
2013-01-10 21:34     ` Jeff King
2013-01-10 23:08       ` Jonathan Nieder

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=20130110133619.GA19232@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=manlio.perillo@gmail.com \
    /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).