xref: /vim-8.2.3635/runtime/syntax/rcs.vim (revision f37506f6)
1" Vim syntax file
2" Language:     RCS file
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
6" Filenames:    *,v
7" Version:      1.12
8
9" Options:
10"   rcs_folding = 1   For folding strings
11
12" quit when a syntax file was already loaded.
13if exists("b:current_syntax")
14  finish
15endif
16
17" RCS file must end with a newline.
18syn match rcsEOFError   ".\%$" containedin=ALL
19
20" Keywords.
21syn keyword rcsKeyword  head branch access symbols locks strict
22syn keyword rcsKeyword  comment expand date author state branches
23syn keyword rcsKeyword  next desc log
24syn keyword rcsKeyword  text nextgroup=rcsTextStr skipwhite skipempty
25
26" Revision numbers and dates.
27syn match rcsNumber "\<[0-9.]\+\>" display
28
29" Strings.
30if exists("rcs_folding") && has("folding")
31  " Folded strings.
32  syn region rcsString  matchgroup=rcsString start="@" end="@" skip="@@" fold contains=rcsSpecial
33  syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" fold contained contains=rcsSpecial,rcsDiffLines
34else
35  syn region rcsString  matchgroup=rcsString start="@" end="@" skip="@@" contains=rcsSpecial
36  syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" contained contains=rcsSpecial,rcsDiffLines
37endif
38syn match rcsSpecial    "@@" contained
39syn match rcsDiffLines  "[da]\d\+ \d\+$" contained
40
41" Synchronization.
42syn sync clear
43if exists("rcs_folding") && has("folding")
44  syn sync fromstart
45else
46  " We have incorrect folding if following sync patterns is turned on.
47  syn sync match rcsSync    grouphere rcsString "[0-9.]\+\(\s\|\n\)\+log\(\s\|\n\)\+@"me=e-1
48  syn sync match rcsSync    grouphere rcsTextStr "@\(\s\|\n\)\+text\(\s\|\n\)\+@"me=e-1
49endif
50
51" Define the default highlighting.
52" Only when an item doesn't have highlighting yet.
53
54hi def link rcsKeyword     Keyword
55hi def link rcsNumber      Identifier
56hi def link rcsString      String
57hi def link rcsTextStr     String
58hi def link rcsSpecial     Special
59hi def link rcsDiffLines   Special
60hi def link rcsEOFError    Error
61
62
63let b:current_syntax = "rcs"
64