3 " Maintainer: Dmitry Vasiliev <dima at hlabs dot spb dot ru>
4 " URL: http://www.hlabs.spb.ru/vim/rcs.vim
5 " Revision: $Id: rcs.vim,v 1.2 2006/03/27 16:41:00 vimboss Exp $
10 " rcs_folding = 1 For folding strings
12 " For version 5.x: Clear all syntax items.
13 " For version 6.x: Quit when a syntax file was already loaded.
16 elseif exists("b:current_syntax")
20 " RCS file must end with a newline.
21 syn match rcsEOFError ".\%$" containedin=ALL
24 syn keyword rcsKeyword head branch access symbols locks strict
25 syn keyword rcsKeyword comment expand date author state branches
26 syn keyword rcsKeyword next desc log
27 syn keyword rcsKeyword text nextgroup=rcsTextStr skipwhite skipempty
29 " Revision numbers and dates.
30 syn match rcsNumber "\<[0-9.]\+\>" display
33 if exists("rcs_folding") && has("folding")
35 syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" fold contains=rcsSpecial
36 syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" fold contained contains=rcsSpecial,rcsDiffLines
38 syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" contains=rcsSpecial
39 syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" contained contains=rcsSpecial,rcsDiffLines
41 syn match rcsSpecial "@@" contained
42 syn match rcsDiffLines "[da]\d\+ \d\+$" contained
46 if exists("rcs_folding") && has("folding")
49 " We have incorrect folding if following sync patterns is turned on.
50 syn sync match rcsSync grouphere rcsString "[0-9.]\+\(\s\|\n\)\+log\(\s\|\n\)\+@"me=e-1
51 syn sync match rcsSync grouphere rcsTextStr "@\(\s\|\n\)\+text\(\s\|\n\)\+@"me=e-1
54 " Define the default highlighting.
55 " For version 5.7 and earlier: only when not done already.
56 " For version 5.8 and later: only when an item doesn't have highlighting yet.
57 if version >= 508 || !exists("did_rcs_syn_inits")
59 let did_rcs_syn_inits = 1
60 command -nargs=+ HiLink hi link <args>
62 command -nargs=+ HiLink hi def link <args>
65 HiLink rcsKeyword Keyword
66 HiLink rcsNumber Identifier
67 HiLink rcsString String
68 HiLink rcsTextStr String
69 HiLink rcsSpecial Special
70 HiLink rcsDiffLines Special
71 HiLink rcsEOFError Error
76 let b:current_syntax = "rcs"