7
|
1 " Vim syntax file
|
|
2 " Language: RCS file
|
|
3 " Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
|
|
4 " URL: http://www.hlabs.spb.ru/vim/rcs.vim
|
|
5 " Last Change: $Date$
|
|
6 " Filenames: *,v
|
|
7 " $Revision$
|
|
8 "
|
|
9 " Options:
|
|
10 " rcs_folding = 1 For folding strings
|
|
11
|
|
12 " For version 5.x: Clear all syntax items.
|
|
13 " For version 6.x: Quit when a syntax file was already loaded.
|
|
14 if version < 600
|
|
15 syntax clear
|
|
16 elseif exists("b:current_syntax")
|
|
17 finish
|
|
18 endif
|
|
19
|
|
20 " RCS file must end with a newline.
|
|
21 syn match rcsEOFError ".\%$" containedin=ALL
|
|
22
|
|
23 " Keywords.
|
|
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
|
|
28
|
|
29 " Revision numbers and dates.
|
|
30 syn match rcsNumber "\<[0-9.]\+\>" display
|
|
31
|
|
32 " Strings.
|
|
33 if exists("rcs_folding") && has("folding")
|
|
34 " Folded strings.
|
|
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
|
|
37 else
|
|
38 syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" contains=rcsSpecial
|
|
39 syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" contained contains=rcsSpecial,rcsDiffLines
|
|
40 endif
|
|
41 syn match rcsSpecial "@@" contained
|
|
42 syn match rcsDiffLines "[da]\d\+ \d\+$" contained
|
|
43
|
|
44 " Synchronization.
|
|
45 syn sync clear
|
|
46 if exists("rcs_folding") && has("folding")
|
|
47 syn sync fromstart
|
|
48 else
|
|
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
|
|
52 endif
|
|
53
|
|
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")
|
|
58 if version <= 508
|
|
59 let did_rcs_syn_inits = 1
|
|
60 command -nargs=+ HiLink hi link <args>
|
|
61 else
|
|
62 command -nargs=+ HiLink hi def link <args>
|
|
63 endif
|
|
64
|
|
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
|
|
72
|
|
73 delcommand HiLink
|
|
74 endif
|
|
75
|
|
76 let b:current_syntax = "rcs"
|