File: ddtpCli.vim

package info (click to toggle)
ddtc 0.17.5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: perl: 2,260; makefile: 87
file content (129 lines) | stat: -rw-r--r-- 3,912 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
" Vim syntax file
" Language: DDTP files - client version
" Maintainer: Lorenzo Cappelletti <lorenzo.cappelletti@email.it>
" Last Change: Tue,  5 Aug 2003 21:47:34 +0200
"

" For copyright statement and stuff, see included file ddtpCom.vim



" Common definitions
runtime syntax/ddtpCom.vim


" Atomic description
syntax region ddtpCliAtom	fold keepend transparent
	\ start=/^# package:/
	\ end=/^$/
	\ contains=ddtpCliHeader,ddtpCliOr,@ddtpCliXx

" Pseudo-header
syntax region ddtpCliHeader	fold keepend transparent contained
	\ start=/^/
	\ end=/^\(# -\)\?Description: /me=s-1
	\ contains=ddtpCliHeaderKey

syntax match  ddtpCliHeaderKey	contained
	\ /^# \(package\|translator\|ddts id\|bug number\|reviewer\)[^:]*/hs=s+2
	\ nextgroup=ddtpComHeaderArg

" Original description
syntax region ddtpCliOr		fold keepend transparent contained
	\ start=/^\(# -\)\?Description: /
	\ end=/^\([>+]>[a-z+-][+-]\)\?Description-\l\l\|^$/me=s-1
	\ contains=ddtpCliOrSynp,ddtpCliOrDesc

syntax region  ddtpCliOrSynp	keepend transparent contained
	\ start=/^\(# -\)\?Description: /
	\ end=/^[ #]/me=e-1
	\ contains=ddtpComSynpKey,ddtpComTodo,
		  \ddtpCliDiffRemoved,@ddtpComErrSynp		" Synopsis

syntax region ddtpCliOrDesc 	fold keepend transparent contained
	\ start=/^ \|#\( -Description\)\@!/
	\ end=/^$/
	\ contains=ddtpCliOrPara,ddtpComDot			" Description

syntax region ddtpCliOrPara	fold transparent contained
	\ start=/^[ #][^\.]/
	\ skip=/^#/
	\ end=/ \.$/me=e-2
	\ contains=@ddtpCliComm,ddtpCliDiffRemoved,
		  \@ddtpComErrPara				" Paragraphs

" Generic translation
syntax region ddtpCliXx		fold keepend transparent contained
	\ start=/^\([>+]>[a-z+-][+-]\)\?Description-\l\l/
	\ end=/^$/me=s-1
	\ contains=ddtpCliXxSynp,ddtpCliXxDesc,@ddtpCliDiff

syntax region  ddtpCliXxSynp	transparent contained
	\ start=/^\([>+]>[a-z+-][+-]\)\?Description-\l\l.*/
	\ end=/^\([>+]>[a-z+-][+-]Description-\l\l.*$\)\@!/
	\ contains=ddtpComSynpKey,ddtpComTodo,@ddtpCliDiff,
		  \@ddtpComErrSynp				" Synopsis

syntax region ddtpCliXxDesc 	fold keepend transparent contained
	\ start=/^\(\([>+]>[a-z+-][+-]\)\?Description-\l\l.*$\)\@!/
	\ end=/^$/
	\ contains=ddtpCliXxPara,ddtpComDot			" Description

syntax region ddtpCliXxPara	fold contained
	\ start=/\(^ \.\)\@!/
	\ skip=/^[#>+]/
	\ end=/ \.$/me=e-2
	\ contains=@ddtpCliComm,ddtpComTodo,@ddtpCliDiff,
		  \@ddtpComErrPara				" Paragraph


" Comments
syntax match  ddtpCliCommServ	/^>[^>].*$/ 	 		contained	" Server
syntax match  ddtpCliCommPerm	/^>>[^a-z+-][^+-].*$/		contained	" Permanent

syntax cluster ddtpCliComm contains=ddtpCliCommServ,ddtpCliCommPerm


" Diff
syntax match  ddtpCliDiffRemoved	/^# -.*/		contained
syntax match  ddtpCliDiffRemoved	/^>>--.*/		contained
syntax match  ddtpCliDiffAddedA		/^>>a+.*/		contained
syntax match  ddtpCliDiffAddedB		/^>>b+.*/		contained
syntax match  ddtpCliDiffAddedC		/^>>c+.*/		contained
syntax match  ddtpCliDiffAddedX		/^>>[d-z+]+.*/		contained
syntax match  ddtpCliDiffSelected	/^+>[a-z+-][+-].*/	contained contains=ddtpCliDiffSelectedHeader
syntax match  ddtpCliDiffSelectedHeader	/^+>[a-z+-][+-]/	contained

syntax cluster ddtpCliDiff contains=ddtpCliDiff.*


" Localized versions
runtime syntax/ddtpCli??.vim
runtime syntax/ddtpCli????.vim
syntax cluster ddtpCliXx contains=ddtpCli..


" Highlighting
highlight ddtpCliDiffAddedA	ctermfg=Magenta
				\ guifg=Magenta
highlight ddtpCliDiffAddedB	ctermfg=Yellow
				\ guifg=Yellow
highlight ddtpCliDiffAddedC	ctermfg=LightBlue
				\ guifg=LightBlue

highlight def link ddtpCliHeaderKey		ddtpComHeaderKey
highlight def link ddtpCliCommServ		ddtpComCommServ
highlight def link ddtpCliCommPerm		ddtpComCommPerm
highlight def link ddtpCliDiffAddedX		diffAdded
highlight def link ddtpCliDiffRemoved		diffRemoved
highlight def link ddtpCliDiffSelectedHeader	Type


" Folding
if !exists("ddts_nofolding")
  set foldmethod=syntax
  1,$foldopen!
endif

let b:current_syntax = "ddtc"