comparison runtime/syntax/bdf.vim @ 375:f14cbd913415 v7.0097

updated for version 7.0097
author vimboss
date Wed, 29 Jun 2005 22:40:58 +0000
parents 3fc0f57ecb91
children 1f3b1021f002
comparison
equal deleted inserted replaced
374:575dacb554d8 375:f14cbd913415
1 " Vim syntax file 1 " Vim syntax file
2 " Language: BDF Font definition 2 " Language: BDF font definition
3 " Maintainer: Nikolai Weibull <source@pcppopper.org> 3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
4 " URL: http://www.pcppopper.org/vim/syntax/pcp/bdf/ 4 " Latest Revision: 2005-06-27
5 " Latest Revision: 2004-05-06
6 " arch-tag: b696b6ba-af24-41ba-b4eb-d248495eca68
7 5
8 if version < 600 6 if exists("b:current_syntax")
9 syntax clear
10 elseif exists("b:current_syntax")
11 finish 7 finish
12 endif 8 endif
13 9
14 " numbers 10 let s:cpo_save = &cpo
15 syn match bdfNumber display "\<\(\x\+\|\d\+\.\d\+\)\>" 11 set cpo&vim
16 12
17 " comments 13 syn region bdfFontDefinition transparent matchgroup=bdfKeyword
18 syn region bdfComment start="^COMMENT\>" end="$" contains=bdfTodo 14 \ start='^STARTFONT\>' end='^ENDFONT\>'
15 \ contains=bdfComment,bdfFont,bdfSize,
16 \ bdfBoundingBox,bdfProperties,bdfChars,bdfChar
19 17
20 " todo 18 syn match bdfNumber contained display
21 syn keyword bdfTodo contained TODO FIXME XXX NOTE 19 \ '\<\%(\x\+\|[+-]\=\d\+\%(\.\d\+\)*\)'
22 20
23 " strings 21 syn keyword bdfTodo contained FIXME TODO XXX NOTE
24 syn region bdfString start=+"+ skip=+""+ end=+"+
25 22
26 " properties 23 syn region bdfComment contained start='^COMMENT\>' end='$'
27 syn keyword bdfProperties contained FONT SIZE FONTBOUNDINGBOX CHARS 24 \ contains=bdfTodo,@Spell
28 25
29 " X11 properties 26 syn region bdfFont contained matchgroup=bdfKeyword
30 syn keyword bdfXProperties contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR 27 \ start='^FONT\>' end='$'
31 syn keyword bdfXProperties contained FONTNAME_REGISTRY FOUNDRY FAMILY_NAME
32 syn keyword bdfXProperties contained WEIGHT_NAME SLANT SETWIDTH_NAME PIXEL_SIZE
33 syn keyword bdfXProperties contained POINT_SIZE RESOLUTION_X RESOLUTION_Y SPACING
34 syn keyword bdfXProperties contained CHARSET_REGISTRY CHARSET_ENCODING COPYRIGHT
35 syn keyword bdfXProperties contained ADD_STYLE_NAME WEIGHT RESOLUTION X_HEIGHT
36 syn keyword bdfXProperties contained QUAD_WIDTH FONT AVERAGE_WIDTH
37 28
38 syn region bdfDefinition transparent matchgroup=bdfDelim start="^STARTPROPERTIES\>" end="^ENDPROPERTIES\>" contains=bdfXProperties,bdfNumber,bdfString 29 syn region bdfSize contained transparent matchgroup=bdfKeyword
30 \ start='^SIZE\>' end='$' contains=bdfNumber
39 31
40 " characters 32 syn region bdfBoundingBox contained transparent matchgroup=bdfKeyword
41 syn keyword bdfCharProperties contained ENCODING SWIDTH DWIDTH BBX ATTRIBUTES BITMAP 33 \ start='^FONTBOUNDINGBOX' end='$'
34 \ contains=bdfNumber
42 35
43 syn match bdfCharName contained display "\<[0-9a-zA-Z]\{1,14}\>" 36 syn region bdfProperties contained transparent matchgroup=bdfKeyword
44 syn match bdfCharNameError contained display "\<[0-9a-zA-Z]\{15,}\>" 37 \ start='^STARTPROPERTIES' end='^ENDPROPERTIES'
38 \ contains=bdfNumber,bdfString,bdfProperty,
39 \ bdfXProperty
45 40
46 syn region bdfStartChar transparent matchgroup=bdfDelim start="\<STARTCHAR\>" end="$" contains=bdfCharName,bdfCharNameError 41 syn keyword bdfProperty contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
42 syn match bdfProperty contained '^\S\+'
47 43
48 syn region bdfCharDefinition transparent start="^STARTCHAR\>" matchgroup=bdfDelim end="^ENDCHAR\>" contains=bdfCharProperties,bdfNumber,bdfStartChar 44 syn keyword bdfXProperty contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
45 \ FONTNAME_REGISTRY FOUNDRY FAMILY_NAME
46 \ WEIGHT_NAME SLANT SETWIDTH_NAME PIXEL_SIZE
47 \ POINT_SIZE RESOLUTION_X RESOLUTION_Y SPACING
48 \ CHARSET_REGISTRY CHARSET_ENCODING COPYRIGHT
49 \ ADD_STYLE_NAME WEIGHT RESOLUTION X_HEIGHT
50 \ QUAD_WIDTH FONT AVERAGE_WIDTH
49 51
50 " font 52 syn region bdfString contained start=+"+ skip=+""+ end=+"+
51 syn region bdfFontDefinition transparent matchgroup=bdfDelim start="^STARTFONT\>" end="^ENDFONT\>" contains=bdfProperties,bdfDefinition,bdfCharDefinition,bdfNumber,bdfComment 53
54 syn region bdfChars contained display transparent
55 \ matchgroup=bdfKeyword start='^CHARS' end='$'
56 \ contains=bdfNumber
57
58 syn region bdfChar transparent matchgroup=bdfKeyword
59 \ start='^STARTCHAR' end='^ENDCHAR'
60 \ contains=bdfEncoding,bdfWidth,bdfAttributes,
61 \ bdfBitmap
62
63 syn region bdfEncoding contained transparent matchgroup=bdfKeyword
64 \ start='^ENCODING' end='$' contains=bdfNumber
65
66 syn region bdfWidth contained transparent matchgroup=bdfKeyword
67 \ start='^SWIDTH\|DWIDTH\|BBX' end='$'
68 \ contains=bdfNumber
69
70 syn region bdfAttributes contained transparent matchgroup=bdfKeyword
71 \ start='^ATTRIBUTES' end='$'
72
73 syn keyword bdfBitmap contained BITMAP
52 74
53 if exists("bdf_minlines") 75 if exists("bdf_minlines")
54 let b:bdf_minlines = bdf_minlines 76 let b:bdf_minlines = bdf_minlines
55 else 77 else
56 let b:bdf_minlines = 50 78 let b:bdf_minlines = 30
57 endif 79 endif
58 exec "syn sync minlines=" . b:bdf_minlines 80 exec "syn sync ccomment bdfChar minlines=" . b:bdf_minlines
59 81
60 " Define the default highlighting.
61 " For version 5.7 and earlier: only when not done already
62 " For version 5.8 and later: only when an item doesn't have highlighting yet
63 if version >= 508 || !exists("did_bdf_syn_inits")
64 if version < 508
65 let did_bdf_syn_inits = 1
66 command -nargs=+ HiLink hi link <args>
67 else
68 command -nargs=+ HiLink hi def link <args>
69 endif
70 82
71 HiLink bdfComment Comment 83 hi def link bdfKeyword Keyword
72 HiLink bdfTodo Todo 84 hi def link bdfNumber Number
73 HiLink bdfNumber Number 85 hi def link bdfTodo Todo
74 HiLink bdfString String 86 hi def link bdfComment Comment
75 HiLink bdfProperties Keyword 87 hi def link bdfFont String
76 HiLink bdfXProperties Keyword 88 hi def link bdfProperty Identifier
77 HiLink bdfCharProperties Structure 89 hi def link bdfXProperty Identifier
78 HiLink bdfDelim Delimiter 90 hi def link bdfString String
79 HiLink bdfCharName String 91 hi def link bdfChars Keyword
80 HiLink bdfCharNameError Error 92 hi def link bdfBitmap Keyword
81 delcommand HiLink
82 endif
83 93
84 let b:current_syntax = "bdf" 94 let b:current_syntax = "bdf"
85 95
86 " vim: set sts=2 sw=2: 96 let &cpo = s:cpo_save
97 unlet s:cpo_save