Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: 3D wavefront's obj file |
| 3 | " Maintainer: Vincent Berthoux <twinside@gmail.com> |
| 4 | " File Types: .obj (used in 3D) |
| 5 | " |
| 6 | " For version 5.x: Clear all syntax items |
| 7 | " For version 6.x: Quit when a syntax file was already loaded |
| 8 | if version < 600 |
| 9 | syntax clear |
| 10 | elseif exists("b:current_syntax") |
| 11 | finish |
| 12 | endif |
| 13 | |
| 14 | syn match objError "^\a\+" |
| 15 | |
| 16 | syn match objKeywords "^cstype\s" |
| 17 | syn match objKeywords "^ctech\s" |
| 18 | syn match objKeywords "^stech\s" |
| 19 | syn match objKeywords "^deg\s" |
| 20 | syn match objKeywords "^curv\(2\?\)\s" |
| 21 | syn match objKeywords "^parm\s" |
| 22 | syn match objKeywords "^surf\s" |
| 23 | syn match objKeywords "^end\s" |
| 24 | syn match objKeywords "^bzp\s" |
| 25 | syn match objKeywords "^bsp\s" |
| 26 | syn match objKeywords "^res\s" |
| 27 | syn match objKeywords "^cdc\s" |
| 28 | syn match objKeywords "^con\s" |
| 29 | |
| 30 | syn match objKeywords "^shadow_obj\s" |
| 31 | syn match objKeywords "^trace_obj\s" |
| 32 | syn match objKeywords "^usemap\s" |
| 33 | syn match objKeywords "^lod\s" |
| 34 | syn match objKeywords "^maplib\s" |
| 35 | syn match objKeywords "^d_interp\s" |
| 36 | syn match objKeywords "^c_interp\s" |
| 37 | syn match objKeywords "^bevel\s" |
| 38 | syn match objKeywords "^mg\s" |
| 39 | syn match objKeywords "^s\s" |
| 40 | syn match objKeywords "^con\s" |
| 41 | syn match objKeywords "^trim\s" |
| 42 | syn match objKeywords "^hole\s" |
| 43 | syn match objKeywords "^scrv\s" |
| 44 | syn match objKeywords "^sp\s" |
| 45 | syn match objKeywords "^step\s" |
| 46 | syn match objKeywords "^bmat\s" |
| 47 | syn match objKeywords "^csh\s" |
| 48 | syn match objKeywords "^call\s" |
| 49 | |
| 50 | syn match objComment "^#.*" |
| 51 | syn match objVertex "^v\s" |
| 52 | syn match objFace "^f\s" |
| 53 | syn match objVertice "^vt\s" |
| 54 | syn match objNormale "^vn\s" |
| 55 | syn match objGroup "^g\s.*" |
| 56 | syn match objMaterial "^usemtl\s.*" |
| 57 | syn match objInclude "^mtllib\s.*" |
| 58 | |
| 59 | syn match objFloat "-\?\d\+\.\d\+\(e\(+\|-\)\d\+\)\?" |
| 60 | syn match objInt "\d\+" |
| 61 | syn match objIndex "\d\+\/\d*\/\d*" |
| 62 | |
| 63 | " Define the default highlighting. |
| 64 | " For version 5.7 and earlier: only when not done already |
| 65 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 66 | if version >= 508 || !exists("did_cabal_syn_inits") |
| 67 | if version < 508 |
| 68 | let did_cabal_syn_inits = 1 |
| 69 | command -nargs=+ HiLink hi link <args> |
| 70 | else |
| 71 | command -nargs=+ HiLink hi def link <args> |
| 72 | endif |
| 73 | |
| 74 | HiLink objError Error |
| 75 | HiLink objComment Comment |
| 76 | HiLink objInclude PreProc |
| 77 | HiLink objFloat Float |
| 78 | HiLink objInt Number |
| 79 | HiLink objGroup Structure |
| 80 | HiLink objIndex Constant |
| 81 | HiLink objMaterial Label |
| 82 | |
| 83 | HiLink objVertex Keyword |
| 84 | HiLink objNormale Keyword |
| 85 | HiLink objVertice Keyword |
| 86 | HiLink objFace Keyword |
| 87 | HiLink objKeywords Keyword |
| 88 | |
| 89 | |
| 90 | delcommand HiLink |
| 91 | endif |
| 92 | |
| 93 | let b:current_syntax = "obj" |
| 94 | |
| 95 | " vim: ts=8 |