7
|
1 " Vim syntax file
|
|
2 " Language: BDF Font definition
|
|
3 " Maintainer: Nikolai Weibull <source@pcppopper.org>
|
|
4 " URL: http://www.pcppopper.org/vim/syntax/pcp/bdf/
|
|
5 " Latest Revision: 2004-05-06
|
|
6 " arch-tag: b696b6ba-af24-41ba-b4eb-d248495eca68
|
|
7
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 " numbers
|
|
15 syn match bdfNumber display "\<\(\x\+\|\d\+\.\d\+\)\>"
|
|
16
|
|
17 " comments
|
|
18 syn region bdfComment start="^COMMENT\>" end="$" contains=bdfTodo
|
|
19
|
|
20 " todo
|
|
21 syn keyword bdfTodo contained TODO FIXME XXX NOTE
|
|
22
|
|
23 " strings
|
|
24 syn region bdfString start=+"+ skip=+""+ end=+"+
|
|
25
|
|
26 " properties
|
|
27 syn keyword bdfProperties contained FONT SIZE FONTBOUNDINGBOX CHARS
|
|
28
|
|
29 " X11 properties
|
|
30 syn keyword bdfXProperties contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
|
|
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
|
|
38 syn region bdfDefinition transparent matchgroup=bdfDelim start="^STARTPROPERTIES\>" end="^ENDPROPERTIES\>" contains=bdfXProperties,bdfNumber,bdfString
|
|
39
|
|
40 " characters
|
|
41 syn keyword bdfCharProperties contained ENCODING SWIDTH DWIDTH BBX ATTRIBUTES BITMAP
|
|
42
|
|
43 syn match bdfCharName contained display "\<[0-9a-zA-Z]\{1,14}\>"
|
|
44 syn match bdfCharNameError contained display "\<[0-9a-zA-Z]\{15,}\>"
|
|
45
|
|
46 syn region bdfStartChar transparent matchgroup=bdfDelim start="\<STARTCHAR\>" end="$" contains=bdfCharName,bdfCharNameError
|
|
47
|
|
48 syn region bdfCharDefinition transparent start="^STARTCHAR\>" matchgroup=bdfDelim end="^ENDCHAR\>" contains=bdfCharProperties,bdfNumber,bdfStartChar
|
|
49
|
|
50 " font
|
|
51 syn region bdfFontDefinition transparent matchgroup=bdfDelim start="^STARTFONT\>" end="^ENDFONT\>" contains=bdfProperties,bdfDefinition,bdfCharDefinition,bdfNumber,bdfComment
|
|
52
|
|
53 if exists("bdf_minlines")
|
|
54 let b:bdf_minlines = bdf_minlines
|
|
55 else
|
|
56 let b:bdf_minlines = 50
|
|
57 endif
|
|
58 exec "syn sync minlines=" . b:bdf_minlines
|
|
59
|
|
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
|
|
71 HiLink bdfComment Comment
|
|
72 HiLink bdfTodo Todo
|
|
73 HiLink bdfNumber Number
|
|
74 HiLink bdfString String
|
|
75 HiLink bdfProperties Keyword
|
|
76 HiLink bdfXProperties Keyword
|
|
77 HiLink bdfCharProperties Structure
|
|
78 HiLink bdfDelim Delimiter
|
|
79 HiLink bdfCharName String
|
|
80 HiLink bdfCharNameError Error
|
|
81 delcommand HiLink
|
|
82 endif
|
|
83
|
|
84 let b:current_syntax = "bdf"
|
|
85
|
|
86 " vim: set sts=2 sw=2:
|