2 " Language: Web2C TeX texmf.cnf configuration file
3 " Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
4 " Last Change: 2001-04-26
5 " URI: http://physics.muni.cz/~yeti/download/texmf.vim
6 " TODO: add `display' where appropriate
9 " React to possibly already-defined syntax.
10 " For version 5.x: Clear all syntax items unconditionally
11 " For version 6.x: Quit when a syntax file was already loaded
13 if exists("b:current_syntax")
23 syn match texmfComment "%..\+$" contains=texmfTodo
24 syn match texmfComment "%\s*$" contains=texmfTodo
25 syn keyword texmfTodo TODO FIXME contained
27 " Constants and parameters {{{
28 syn match texmfPassedParameter "[-+]\=%\w\W"
29 syn match texmfPassedParameter "[-+]\=%\w$"
30 syn match texmfNumber "\<\d\+\>"
31 syn match texmfVariable "\$\(\w\k*\|{\w\k*}\)"
32 syn match texmfSpecial +\\"\|\\$+
33 syn region texmfString start=+"+ end=+"+ skip=+\\"\\\\+ contains=texmfVariable,texmfSpecial,texmfPassedParameter
36 syn match texmfLHSStart "^\s*\w\k*" nextgroup=texmfLHSDot,texmfEquals
37 syn match texmfLHSVariable "\w\k*" contained nextgroup=texmfLHSDot,texmfEquals
38 syn match texmfLHSDot "\." contained nextgroup=texmfLHSVariable
39 syn match texmfEquals "\s*=" contained
42 syn match texmfComma "," contained
43 syn match texmfColons ":\|;"
44 syn match texmfDoubleExclam "!!" contained
46 " Catch errors caused by wrong parenthesization {{{
47 syn region texmfBrace matchgroup=texmfBraceBrace start="{" end="}" contains=ALLBUT,texmfTodo,texmfBraceError,texmfLHSVariable,texmfLHSDot transparent
48 syn match texmfBraceError "}"
50 " Define the default highlighting {{{
51 " For version 5.7 and earlier: Only when not done already
52 " For version 5.8 and later: Only when an item doesn't have highlighting yet
53 if version >= 508 || !exists("did_texmf_syntax_inits")
55 let did_texmf_syntax_inits = 1
56 command -nargs=+ HiLink hi link <args>
58 command -nargs=+ HiLink hi def link <args>
61 HiLink texmfComment Comment
64 HiLink texmfPassedParameter texmfVariable
65 HiLink texmfVariable Identifier
67 HiLink texmfNumber Number
68 HiLink texmfString String
70 HiLink texmfLHSStart texmfLHS
71 HiLink texmfLHSVariable texmfLHS
72 HiLink texmfLHSDot texmfLHS
75 HiLink texmfEquals Normal
77 HiLink texmfBraceBrace texmfDelimiter
78 HiLink texmfComma texmfDelimiter
79 HiLink texmfColons texmfDelimiter
80 HiLink texmfDelimiter Preproc
82 HiLink texmfDoubleExclam Statement
83 HiLink texmfSpecial Special
85 HiLink texmfBraceError texmfError
86 HiLink texmfError Error
91 let b:current_syntax = "texmf"