annotate runtime/syntax/pod.vim @ 1303:da0991871b02 v7.1.017

updated for version 7.1-017
author vimboss
date Thu, 28 Jun 2007 20:02:32 +0000
parents 96cd8222a819
children 9397d2d76340
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Perl POD format
26
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
3 " Maintainer: Scott Bigham <dsb@killerbunnies.org>
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 398
diff changeset
4 " Last Change: 2007 Jan 21
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " To add embedded POD documentation highlighting to your syntax file, add
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " the commands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " syn include @Pod <sfile>:p:h/pod.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " syn region myPOD start="^=pod" start="^=head" end="^=cut" keepend contained contains=@Pod
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " and add myPod to the contains= list of some existing region, probably a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " comment. The "keepend" flag is needed because "=cut" is matched as a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " pattern in its own right.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Remove any old syntax stuff hanging around (this is suppressed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " automatically by ":syn include" if necessary).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " POD commands
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
28 syn match podCommand "^=head[1234]" nextgroup=podCmdText contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
29 syn match podCommand "^=item" nextgroup=podCmdText contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
30 syn match podCommand "^=over" nextgroup=podOverIndent skipwhite contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
31 syn match podCommand "^=back" contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
32 syn match podCommand "^=cut" contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
33 syn match podCommand "^=pod" contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
34 syn match podCommand "^=for" nextgroup=podForKeywd skipwhite contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
35 syn match podCommand "^=begin" nextgroup=podForKeywd skipwhite contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
36 syn match podCommand "^=end" nextgroup=podForKeywd skipwhite contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Text of a =head1, =head2 or =item command
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
39 syn match podCmdText ".*$" contained contains=podFormat,@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Indent amount of =over command
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
42 syn match podOverIndent "\d\+" contained contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Formatter identifier keyword for =for, =begin and =end commands
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
45 syn match podForKeywd "\S\+" contained contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " An indented line, to be displayed verbatim
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
48 syn match podVerbatimLine "^\s.*$" contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " Inline textual items handled specially by POD
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
51 syn match podSpecial "\(\<\|&\)\I\i*\(::\I\i*\)*([^)]*)" contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
52 syn match podSpecial "[$@%]\I\i*\(::\I\i*\)*\>" contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " Special formatting sequences
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
55 syn region podFormat start="[IBSCLFX]<[^<]"me=e-1 end=">" oneline contains=podFormat,@NoSpell
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 398
diff changeset
56 syn region podFormat start="[IBSCLFX]<<\s" end="\s>>" oneline contains=podFormat,@NoSpell
26
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
57 syn match podFormat "Z<>"
398
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
58 syn match podFormat "E<\(\d\+\|\I\i*\)>" contains=podEscape,podEscape2,@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
59 syn match podEscape "\I\i*>"me=e-1 contained contains=@NoSpell
d5dbe17efce2 updated for version 7.0105
vimboss
parents: 26
diff changeset
60 syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 if version >= 508 || !exists("did_pod_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 let did_pod_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink podCommand Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink podCmdText String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink podOverIndent Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink podForKeywd Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink podFormat Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink podVerbatimLine PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink podSpecial Identifier
26
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
80 HiLink podEscape String
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
81 HiLink podEscape2 Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 let b:current_syntax = "pod"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 " vim: ts=8