rcs.vim (2133B)
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. 13 if exists("b:current_syntax") 14 finish 15 endif 16 17 " RCS file must end with a newline. 18 syn match rcsEOFError ".\%$" containedin=ALL 19 20 " Keywords. 21 syn keyword rcsKeyword head branch access symbols locks strict 22 syn keyword rcsKeyword comment expand date author state branches 23 syn keyword rcsKeyword next desc log 24 syn keyword rcsKeyword text nextgroup=rcsTextStr skipwhite skipempty 25 26 " Revision numbers and dates. 27 syn match rcsNumber "\<[0-9.]\+\>" display 28 29 " Strings. 30 if 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 34 else 35 syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" contains=rcsSpecial 36 syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" contained contains=rcsSpecial,rcsDiffLines 37 endif 38 syn match rcsSpecial "@@" contained 39 syn match rcsDiffLines "[da]\d\+ \d\+$" contained 40 41 " Synchronization. 42 syn sync clear 43 if exists("rcs_folding") && has("folding") 44 syn sync fromstart 45 else 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 49 endif 50 51 " Define the default highlighting. 52 " Only when an item doesn't have highlighting yet. 53 54 hi def link rcsKeyword Keyword 55 hi def link rcsNumber Identifier 56 hi def link rcsString String 57 hi def link rcsTextStr String 58 hi def link rcsSpecial Special 59 hi def link rcsDiffLines Special 60 hi def link rcsEOFError Error 61 62 63 let b:current_syntax = "rcs"