Start anew
[msysgit.git] / share / vim / vim58 / syntax / matlab.vim
blob1dc6edb9ed4f70a3608afbf7f477a01685fb18fa
1 " Vim syntax file
2 " Language:     Matlab
3 " Maintainer:   Preben "Peppe" Guldberg <c928400@student.dtu.dk>
4 "               Original author: Mario Eusebio
5 " Last Change:  Tue Jul 28 17:44:06 1998
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
9 if version < 600
10   syntax clear
11 elseif exists("b:current_syntax")
12   finish
13 endif
15 syn keyword matlabStatement             return
16 syn keyword matlabLabel                 case switch
17 syn keyword matlabConditional           else elseif end if otherwise
18 syn keyword matlabRepeat                do for while
20 syn keyword matlabTodo                  contained  TODO
22 " If you do not want these operators lit, uncommment them and the "hi link" below
23 syn match matlabArithmeticOperator      "[-+]"
24 syn match matlabArithmeticOperator      "\.\=[*/\\^]"
25 syn match matlabRelationalOperator      "[=~]="
26 syn match matlabRelationalOperator      "[<>]=\="
27 syn match matlabLogicalOperator         "[&|~]"
29 syn match matlabLineContinuation        "\.\{3}"
31 "syn match matlabIdentifier             "\<\a\w*\>"
33 " String
34 syn region matlabString                 start=+'+ end=+'+       oneline
36 " If you don't like tabs
37 syn match matlabTab                     "\t"
39 " Standard numbers
40 syn match matlabNumber          "\<\d\+[ij]\=\>"
41 " floating point number, with dot, optional exponent
42 syn match matlabFloat           "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>"
43 " floating point number, starting with a dot, optional exponent
44 syn match matlabFloat           "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>"
46 " Transpose character and delimiters: Either use just [...] or (...) aswell
47 syn match matlabDelimiter               "[][]"
48 "syn match matlabDelimiter              "[][()]"
49 syn match matlabTransposeOperator       "[])a-zA-Z0-9.]'"lc=1
51 syn match matlabSemicolon               ";"
53 syn match matlabComment                 "%.*$"  contains=matlabTodo,matlabTab
55 syn keyword matlabOperator              break zeros default margin round ones rand
56 syn keyword matlabOperator              ceil floor size clear zeros eye mean std cov
58 syn keyword matlabFunction              error eval function
60 syn keyword matlabImplicit              abs acos atan asin cos cosh exp log prod sum
61 syn keyword matlabImplicit              log10 max min sign sin sqrt tan reshape
63 syn match matlabError   "-\=\<\d\+\.\d\+\.[^*/\\^]"
64 syn match matlabError   "-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)"
66 " Define the default highlighting.
67 " For version 5.7 and earlier: only when not done already
68 " For version 5.8 and later: only when an item doesn't have highlighting yet
69 if version >= 508 || !exists("did_matlab_syntax_inits")
70   if version < 508
71     let did_matlab_syntax_inits = 1
72     command -nargs=+ HiLink hi link <args>
73   else
74     command -nargs=+ HiLink hi def link <args>
75   endif
77   HiLink matlabTransposeOperator        matlabOperator
78   HiLink matlabOperator         Operator
79   HiLink matlabLineContinuation Special
80   HiLink matlabLabel                    Label
81   HiLink matlabConditional              Conditional
82   HiLink matlabRepeat                   Repeat
83   HiLink matlabTodo                     Todo
84   HiLink matlabString                   String
85   HiLink matlabDelimiter                Identifier
86   HiLink matlabTransposeOther           Identifier
87   HiLink matlabNumber                   Number
88   HiLink matlabFloat                    Float
89   HiLink matlabFunction         Function
90   HiLink matlabError                    Error
91   HiLink matlabImplicit         matlabStatement
92   HiLink matlabStatement                Statement
93   HiLink matlabSemicolon                SpecialChar
94   HiLink matlabComment                  Comment
96   HiLink matlabArithmeticOperator       matlabOperator
97   HiLink matlabRelationalOperator       matlabOperator
98   HiLink matlabLogicalOperator          matlabOperator
100 "optional highlighting
101   "HiLink matlabIdentifier              Identifier
102   "HiLink matlabTab                     Error
104   delcommand HiLink
105 endif
107 let b:current_syntax = "matlab"
109 "EOF    vim: ts=8 noet tw=100 sw=8 sts=0