git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: about vim contrib support

From
Jeff King <peff@peff.net>
Date
Jan 10, 2013, 13:36 UTC
Message-ID
<20130110133619.GA19232@sigill.intra.peff.net>
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
Previous: Manlio PerilloNext: Jonathan Nieder
Message 4 of 7 in “about vim contrib support”
  1. Manlio PerilloJan 10, 2013
  2. Jeff KingJan 10, 2013
  3. Manlio PerilloJan 10, 2013
  4. Jeff KingJan 10, 2013
  5. contrib/vim: simplify instructions for old vim supportJonathan Nieder, Jan 10, 2013
  6. Jeff KingJan 10, 2013
  7. Jonathan NiederJan 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.