[PATCH] be more vim-ish, and also syntax hilight Signed-off-by lines.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Pierre Habouzit
Date: Monday, October 16, 2006 - 5:31 pm

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 contrib/vim/syntax/gitcommit.vim |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/contrib/vim/syntax/gitcommit.vim b/contrib/vim/syntax/gitcommit.vim
index a9de09f..d0c6e5d 100644
--- a/contrib/vim/syntax/gitcommit.vim
+++ b/contrib/vim/syntax/gitcommit.vim
@@ -1,3 +1,14 @@
+" Vim syntax file
+" Language:	git commit message
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syn region gitSignedOff start=/^Signed-off-by:/ end=/$/ contains=gitAuthor,gitEmail
+syn region gitAuthor contained start=/\s/ end=/$/
+
 syn region gitLine start=/^#/ end=/$/
 syn region gitCommit start=/^# Updated but not checked in:$/ end=/^#$/ contains=gitHead,gitCommitFile
 syn region gitHead contained start=/^#   (.*)/ end=/^#$/
@@ -8,6 +19,9 @@ syn match gitCommitFile contained /^#\t.
 syn match gitChangedFile contained /^#\t.*/hs=s+2
 syn match gitUntrackedFile contained /^#\t.*/hs=s+2
 
+hi def link gitSignedOff Keyword
+hi def link gitAuthor Normal
+
 hi def link gitLine Comment
 hi def link gitCommit Comment
 hi def link gitChanged Comment
@@ -16,3 +30,7 @@ hi def link gitUntracked Comment
 hi def link gitCommitFile Type
 hi def link gitChangedFile Constant
 hi def link gitUntrackedFile Constant
+
+let b:current_syntax = "git"
+
+" vim: ts=8 sw=2
-- 
1.4.2.3

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] be more vim-ish, and also syntax hilight Signed-of ..., Pierre Habouzit, (Mon Oct 16, 5:31 pm)