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

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

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 18, 2006, 00:39 UTC
Message-ID
<11611319762395-git-send-email-madcoder@debian.org>
In-Reply-To
<1161131976193-git-send-email-madcoder@debian.org>
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
Previous: Pierre HabouzitNext: Pierre Habouzit
Message 13 of 23 in “be more vim-ish, and also syntax hilight Signed-off-by lines.”
  1. be more vim-ish, and also syntax hilight Signed-off-by lines.Pierre Habouzit, Oct 17, 2006
  2. nice ftplugin for vim, that shows the commited diff in a split'ed buffer.Pierre Habouzit, Oct 17, 2006
  3. Peter BaumannOct 17, 2006
  4. Pierre HabouzitOct 17, 2006
  5. Peter BaumannOct 17, 2006
  6. Pierre HabouzitOct 17, 2006
  7. Christian MICHONOct 17, 2006
  8. Junio C HamanoOct 17, 2006
  9. Petr BaudisOct 18, 2006
  10. Junio C HamanoOct 17, 2006
  11. contrib/vim patches, replace the previous setPierre Habouzit, Oct 18, 2006
  12. contrib/vim patches, replace the previous setPierre Habouzit, Oct 18, 2006
  13. be more vim-ish, and also syntax hilight Signed-off-by lines.Pierre Habouzit, Oct 18, 2006
  14. Nice ftplugin for vim, that shows the commited diff in a split'ed buffer.Pierre Habouzit, Oct 18, 2006
  15. Pierre HabouzitOct 18, 2006
  16. Make the ftplugin right wrt gitdirPierre Habouzit, Oct 18, 2006
  17. be more robust wrt the git-dir.Pierre Habouzit, Oct 18, 2006
  18. Jeff KingOct 18, 2006
  19. Pierre HabouzitOct 18, 2006
  20. Jeff KingOct 18, 2006
  21. Pierre HabouzitOct 18, 2006
  22. Jeff KingOct 18, 2006
  23. Jeff KingOct 18, 2006

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.