annotate runtime/syntax/rtf.vim @ 6497:749fc929da45 v7.4.576

updated for version 7.4.576 Problem: Redrawing problem with 'relativenumber' and 'linebreak'. Solution: Temporarily reset 'linebreak' and restore it in more places. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Wed, 14 Jan 2015 17:52:30 +0100
parents 3fc0f57ecb91
children 43efa4f5a8ea
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: Rich Text Format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " "*.rtf" files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " The Rich Text Format (RTF) Specification is a method of encoding formatted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " text and graphics for easy transfer between applications.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " .hlp (windows help files) use compiled rtf files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " rtf documentation at http://night.primate.wisc.edu/software/RTF/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Maintainer: Dominique Stéphan (dominique@mggen.com)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " URL: http://www.mggen.com/vim/syntax/rtf.zip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Last change: 2001 Mai 02
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " TODO: render underline, italic, bold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " case on (all controls must be lower case)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Control Words
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match rtfControlWord "\\[a-z]\+[\-]\=[0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " New Control Words (not in the 1987 specifications)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match rtfNewControlWord "\\\*\\[a-z]\+[\-]\=[0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Control Symbol : any \ plus a non alpha symbol, *, \, { and } and '
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match rtfControlSymbol "\\[^a-zA-Z\*\{\}\\']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " { } and \ are special characters, to use them
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " we add a backslash \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match rtfCharacter "\\\\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match rtfCharacter "\\{"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match rtfCharacter "\\}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Escaped characters (for 8 bytes characters upper than 127)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match rtfCharacter "\\'[A-Za-z0-9][A-Za-z0-9]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Unicode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match rtfUnicodeCharacter "\\u[0-9][0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Color values, we will put this value in Red, Green or Blue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match rtfRed "\\red[0-9][0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match rtfGreen "\\green[0-9][0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match rtfBlue "\\blue[0-9][0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Some stuff for help files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match rtfFootNote "[#$K+]{\\footnote.*}" contains=rtfControlWord,rtfNewControlWord
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " 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
57 if version >= 508 || !exists("did_rtf_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 let did_rtf_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink rtfControlWord Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink rtfNewControlWord Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink rtfControlSymbol Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink rtfCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink rtfUnicodeCharacter SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink rtfFootNote Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " Define colors for the syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 hi rtfRed term=underline cterm=underline ctermfg=DarkRed gui=underline guifg=DarkRed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 hi rtfGreen term=underline cterm=underline ctermfg=DarkGreen gui=underline guifg=DarkGreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 hi rtfBlue term=underline cterm=underline ctermfg=DarkBlue gui=underline guifg=DarkBlue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink rtfRed rtfRed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink rtfGreen rtfGreen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 HiLink rtfBlue rtfBlue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
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 = "rtf"
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