2 " Language: SVN commit file
3 " Maintainer: Ben Collins <bcollins@debian.org>
5 " Last Change: Tue Oct 22 00:22:19 EDT 2002
7 " Based on the similar CVS commit file syntax
9 " Place this file as ~/.vim/syntax/svn.vim
11 " Then add the following lines to ~/.vimrc
13 " au BufNewFile,BufRead svn-commit.* setf svn
15 " For version 5.x: Clear all syntax items
16 " For version 6.x: Quit when a syntax file was already loaded
19 elseif exists("b:current_syntax")
23 syn cluster svnChange contains=svnAdd,svnDel,svnMod,svnProp
24 syn match svnLine /^--This line, and those below, will be ignored--$/ skipwhite skipnl skipempty nextgroup=@svnChange
25 syn match svnAdd /^A[M ] .*$/ contained skipwhite skipnl skipempty nextgroup=@svnChange
26 syn match svnDel /^D[M ] .*$/ contained skipwhite skipnl skipempty nextgroup=@svnChange
27 syn match svnMod /^M[M ] .*$/ contained skipwhite skipnl skipempty nextgroup=@svnChange
28 syn match svnProp /^_[M ] .*$/ contained skipwhite skipnl skipempty nextgroup=@svnChange
30 "The following is the old SVN template format markings
32 "syn region svnLine start="^SVN:" end="$" contains=svnAdd,svnDel,svnMod
33 "syn match svnAdd contained " [A_][ A] .*"
34 "syn match svnDel contained " [D_][ D] .*"
35 "syn match svnMod contained " [M_][ M] .*"
37 " Define the default highlighting.
38 " For version 5.7 and earlier: only when not done already
39 " For version 5.8 and later: only when an item doesn't have highlighting yet
40 if version >= 508 || !exists("did_svn_syn_inits")
42 let did_svn_syn_inits = 1
43 command -nargs=+ HiLink hi link <args>
45 command -nargs=+ HiLink hi def link <args>
48 HiLink svnAdd Structure
49 HiLink svnDel SpecialChar
51 HiLink svnProp Keyword
52 HiLink svnLine Comment
57 let b:current_syntax = "svn"