[7.2.325] A stray "w" in the startup vimrc file causes the edited file to be
[vim_mainline.git] / runtime / syntax / ppwiz.vim
blobd3d7b3a17a11d0ac1da16b0b6f645ef2c39c0d01
1 " Vim syntax file
2 " Language:     PPWizard (preprocessor by Dennis Bareis)
3 " Maintainer:   Stefan Schwarzer <s.schwarzer@ndh.net>
4 " URL:                  http://www.ndh.net/home/sschwarzer/download/ppwiz.vim
5 " Last Change:  2003 May 11
6 " Filename:     ppwiz.vim
8 " Remove old syntax stuff
9 " For version 5.x: Clear all syntax items
10 " For version 6.x: Quit when a syntax file was already loaded
11 if version < 600
12   syntax clear
13 elseif exists("b:current_syntax")
14   finish
15 endif
17 syn case ignore
19 if !exists("ppwiz_highlight_defs")
20     let ppwiz_highlight_defs = 1
21 endif
23 if !exists("ppwiz_with_html")
24     let ppwiz_with_html = 1
25 endif
27 " comments
28 syn match   ppwizComment  "^;.*$"
29 syn match   ppwizComment  ";;.*$"
30 " HTML
31 if ppwiz_with_html > 0
32     syn region ppwizHTML  start="<" end=">" contains=ppwizArg,ppwizMacro
33     syn match  ppwizHTML  "\&\w\+;"
34 endif
35 " define, evaluate etc.
36 if ppwiz_highlight_defs == 1
37     syn match  ppwizDef   "^\s*\#\S\+\s\+\S\+" contains=ALL
38     syn match  ppwizDef   "^\s*\#\(if\|else\|endif\)" contains=ALL
39     syn match  ppwizDef   "^\s*\#\({\|break\|continue\|}\)" contains=ALL
40 " elseif ppwiz_highlight_defs == 2
41 "     syn region ppwizDef   start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ALL
42 else
43     syn region ppwizDef   start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ppwizCont
44 endif
45 syn match   ppwizError    "\s.\\$"
46 syn match   ppwizCont     "\s\([+\-%]\|\)\\$"
47 " macros to execute
48 syn region  ppwizMacro    start="<\$" end=">" contains=@ppwizArgVal,ppwizCont
49 " macro arguments
50 syn region  ppwizArg      start="{" end="}" contains=ppwizEqual,ppwizString
51 syn match   ppwizEqual    "=" contained
52 syn match   ppwizOperator "<>\|=\|<\|>" contained
53 " standard variables (builtin)
54 syn region  ppwizStdVar   start="<?[^?]" end=">" contains=@ppwizArgVal
55 " Rexx variables
56 syn region  ppwizRexxVar  start="<??" end=">" contains=@ppwizArgVal
57 " Constants
58 syn region  ppwizString   start=+"+ end=+"+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar
59 syn region  ppwizString   start=+'+ end=+'+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar
60 syn match   ppwizInteger  "\d\+" contained
62 " Clusters
63 syn cluster ppwizArgVal add=ppwizString,ppwizInteger
65 " Define the default highlighting.
66 " For version 5.7 and earlier: only when not done already
67 " For version 5.8 and later: only when an item doesn't have highlighting yet
68 if version >= 508 || !exists("did_ppwiz_syn_inits")
69     if version < 508
70                 let did_ppwiz_syn_inits = 1
71                 command -nargs=+ HiLink hi link <args>
72         else
73                 command -nargs=+ HiLink hi def link <args>
74     endif
76     HiLink ppwizSpecial  Special
77     HiLink ppwizEqual    ppwizSpecial
78     HiLink ppwizOperator ppwizSpecial
79     HiLink ppwizComment  Comment
80     HiLink ppwizDef      PreProc
81     HiLink ppwizMacro    Statement
82     HiLink ppwizArg      Identifier
83     HiLink ppwizStdVar   Identifier
84     HiLink ppwizRexxVar  Identifier
85     HiLink ppwizString   Constant
86     HiLink ppwizInteger  Constant
87     HiLink ppwizCont     ppwizSpecial
88     HiLink ppwizError    Error
89     HiLink ppwizHTML     Type
91     delcommand HiLink
92 endif
94 let b:current_syntax = "ppwiz"
96 " vim: ts=4