7
|
1 " Vim syntax file
|
810
|
2 " Language: RCS file
|
3356
|
3 " Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
|
4 " URL: https://github.com/hdima/vim-scripts/blob/master/syntax/rcs.vim
|
|
5 " Last Change: 2012-02-11
|
810
|
6 " Filenames: *,v
|
3356
|
7 " Version: 1.12
|
810
|
8
|
7
|
9 " Options:
|
810
|
10 " rcs_folding = 1 For folding strings
|
7
|
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.
|
810
|
21 syn match rcsEOFError ".\%$" containedin=ALL
|
7
|
22
|
|
23 " Keywords.
|
810
|
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
|
7
|
28
|
|
29 " Revision numbers and dates.
|
810
|
30 syn match rcsNumber "\<[0-9.]\+\>" display
|
7
|
31
|
|
32 " Strings.
|
|
33 if exists("rcs_folding") && has("folding")
|
|
34 " Folded strings.
|
810
|
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
|
7
|
37 else
|
810
|
38 syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" contains=rcsSpecial
|
|
39 syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" contained contains=rcsSpecial,rcsDiffLines
|
7
|
40 endif
|
810
|
41 syn match rcsSpecial "@@" contained
|
|
42 syn match rcsDiffLines "[da]\d\+ \d\+$" contained
|
7
|
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.
|
810
|
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
|
7
|
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
|
810
|
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
|
7
|
72
|
|
73 delcommand HiLink
|
|
74 endif
|
|
75
|
|
76 let b:current_syntax = "rcs"
|