-----BEGIN PGP SIGNED MESSAGE-----
In the contrib/vim/README file there are instructions about how to setup
git support with Vim builtin git syntax files.
However these instructions seems to be redundant, since the system
filetype.vim file already have the autocmd rules.
The only issue I found is with:
autocmd BufNewFile,BufRead .msg.[0-9]*
\ if getline(1) =~ '^From.*# This line is ignored.$' |
\ setf gitsendemail |
It should be:
autocmd BufNewFile,BufRead [0-9]*.patch
IMHO it should contain some other checks, to make sure it is a patch
generated by git format-patch, and not, as an example, a plain patch or
a Mercurial patch.
By the way: I don't understand the purpose of gitsendemail syntax.
On my system it does not highlight the diff.
I have implemented an alternate gitpatch syntax file, attached.
What I would like to get, is to syntax highligth the commit subject
message, but I'm not a Vim expert.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
" Vim syntax file
" Language: git format-patch message
" Maintainer: Manlio Perillo
" Filenames: [0-9]*.patch (first line is "From ... # This line is ignored.")
" Last Change: 2014 Gen 10
syn case match
syn match gitsendemailComment "\%^From.*#.*"
syn match gitsendemailComment "^GIT:.*"
syn spell toplevel
syn include @gitcommitMessage syntax/gitcommit.vim
syn region gitcommitMessage start=/^Subject: \@=/ end=/^$|^#\@=/
hi def link gitsendemailComment Comment
let b:current_syntax = "gitpatch"