bdf.vim (3841B)
1 " Vim syntax file 2 " Language: BDF font definition 3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> 4 " Latest Revision: 2006-04-19 5 6 if exists("b:current_syntax") 7 finish 8 endif 9 10 let s:cpo_save = &cpo 11 set cpo&vim 12 13 syn region bdfFontDefinition transparent matchgroup=bdfKeyword 14 \ start='^STARTFONT\>' end='^ENDFONT\>' 15 \ contains=bdfComment,bdfFont,bdfSize, 16 \ bdfBoundingBox,bdfProperties,bdfChars,bdfChar 17 18 syn match bdfNumber contained display 19 \ '\<\%(\x\+\|[+-]\=\d\+\%(\.\d\+\)*\)' 20 21 syn keyword bdfTodo contained FIXME TODO XXX NOTE 22 23 syn region bdfComment contained start='^COMMENT\>' end='$' 24 \ contains=bdfTodo,@Spell 25 26 syn region bdfFont contained matchgroup=bdfKeyword 27 \ start='^FONT\>' end='$' 28 29 syn region bdfSize contained transparent matchgroup=bdfKeyword 30 \ start='^SIZE\>' end='$' contains=bdfNumber 31 32 syn region bdfBoundingBox contained transparent matchgroup=bdfKeyword 33 \ start='^FONTBOUNDINGBOX' end='$' 34 \ contains=bdfNumber 35 36 syn region bdfProperties contained transparent matchgroup=bdfKeyword 37 \ start='^STARTPROPERTIES' end='^ENDPROPERTIES' 38 \ contains=bdfNumber,bdfString,bdfProperty, 39 \ bdfXProperty 40 41 syn keyword bdfProperty contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR 42 syn match bdfProperty contained '^\S\+' 43 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 51 52 syn region bdfString contained start=+"+ skip=+""+ end=+"+ 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 74 75 if exists("bdf_minlines") 76 let b:bdf_minlines = bdf_minlines 77 else 78 let b:bdf_minlines = 30 79 endif 80 exec "syn sync ccomment bdfChar minlines=" . b:bdf_minlines 81 82 83 hi def link bdfKeyword Keyword 84 hi def link bdfNumber Number 85 hi def link bdfTodo Todo 86 hi def link bdfComment Comment 87 hi def link bdfFont String 88 hi def link bdfProperty Identifier 89 hi def link bdfXProperty Identifier 90 hi def link bdfString String 91 hi def link bdfChars Keyword 92 hi def link bdfBitmap Keyword 93 94 let b:current_syntax = "bdf" 95 96 let &cpo = s:cpo_save 97 unlet s:cpo_save