| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							|  |  |  | " Language:	Matlab | 
					
						
							| 
									
										
										
										
											2017-01-28 18:34:47 +01:00
										 |  |  | " Maintainer:	Alex Burka <vim@alexburka.com> | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " Credits:	Preben 'Peppe' Guldberg <peppe-vim@wielders.org> | 
					
						
							| 
									
										
										
										
											2017-01-28 18:34:47 +01:00
										 |  |  | "		Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | "		Original author: Mario Eusebio | 
					
						
							| 
									
										
										
										
											2019-06-10 22:47:40 +02:00
										 |  |  | " Last Change:	June 10 2019 | 
					
						
							|  |  |  | " 		added highlight rule for double-quoted string literals | 
					
						
							| 
									
										
										
										
											2011-06-19 05:09:16 +02:00
										 |  |  | " Change History: | 
					
						
							| 
									
										
										
										
											2019-06-10 22:47:40 +02:00
										 |  |  | "               - double-quoted string literals added | 
					
						
							| 
									
										
										
										
											2017-01-28 18:34:47 +01:00
										 |  |  | " 		- now highlights cell-mode separator comments | 
					
						
							| 
									
										
										
										
											2010-01-16 14:29:14 +01:00
										 |  |  | " 		- 'global' and 'persistent' keyword are now recognized | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " quit when a syntax file was already loaded | 
					
						
							|  |  |  | if exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn keyword matlabStatement		return | 
					
						
							|  |  |  | syn keyword matlabLabel			case switch | 
					
						
							|  |  |  | syn keyword matlabConditional		else elseif end if otherwise | 
					
						
							|  |  |  | syn keyword matlabRepeat		do for while | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " MT_ADDON - added exception-specific keywords | 
					
						
							|  |  |  | syn keyword matlabExceptions		try catch | 
					
						
							|  |  |  | syn keyword matlabOO			classdef properties events methods | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn keyword matlabTodo			contained  TODO | 
					
						
							| 
									
										
										
										
											2010-01-16 14:29:14 +01:00
										 |  |  | syn keyword matlabScope			global persistent | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " If you do not want these operators lit, uncommment them and the "hi link" below | 
					
						
							|  |  |  | syn match matlabArithmeticOperator	"[-+]" | 
					
						
							|  |  |  | syn match matlabArithmeticOperator	"\.\=[*/\\^]" | 
					
						
							|  |  |  | syn match matlabRelationalOperator	"[=~]=" | 
					
						
							|  |  |  | syn match matlabRelationalOperator	"[<>]=\=" | 
					
						
							|  |  |  | syn match matlabLogicalOperator		"[&|~]" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn match matlabLineContinuation	"\.\{3}" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | "syn match matlabIdentifier		"\<\a\w*\>" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " String | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence  | 
					
						
							| 
									
										
										
										
											2010-01-16 14:29:14 +01:00
										 |  |  | syn region matlabString			start=+'+ end=+'+	oneline skip=+''+ | 
					
						
							| 
									
										
										
										
											2019-06-10 22:47:40 +02:00
										 |  |  | syn region matlabStringArray		start=+"+ end=+"+	oneline skip=+""+ | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " If you don't like tabs | 
					
						
							|  |  |  | syn match matlabTab			"\t" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Standard numbers | 
					
						
							|  |  |  | syn match matlabNumber		"\<\d\+[ij]\=\>" | 
					
						
							|  |  |  | " floating point number, with dot, optional exponent | 
					
						
							|  |  |  | syn match matlabFloat		"\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>" | 
					
						
							|  |  |  | " floating point number, starting with a dot, optional exponent | 
					
						
							|  |  |  | syn match matlabFloat		"\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Transpose character and delimiters: Either use just [...] or (...) aswell | 
					
						
							|  |  |  | syn match matlabDelimiter		"[][]" | 
					
						
							|  |  |  | "syn match matlabDelimiter		"[][()]" | 
					
						
							|  |  |  | syn match matlabTransposeOperator	"[])a-zA-Z0-9.]'"lc=1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn match matlabSemicolon		";" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-16 14:29:14 +01:00
										 |  |  | syn match matlabComment			"%.*$"	contains=matlabTodo,matlabTab | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " MT_ADDON - correctly highlights words after '...' as comments | 
					
						
							| 
									
										
										
										
											2010-01-16 14:29:14 +01:00
										 |  |  | syn match matlabComment			"\.\.\..*$"	contains=matlabTodo,matlabTab | 
					
						
							|  |  |  | syn region matlabMultilineComment	start=+%{+ end=+%}+ contains=matlabTodo,matlabTab | 
					
						
							| 
									
										
										
										
											2017-01-28 18:34:47 +01:00
										 |  |  | syn match matlabCellComment     "^%%.*$" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn keyword matlabOperator		break zeros default margin round ones rand | 
					
						
							|  |  |  | syn keyword matlabOperator		ceil floor size clear zeros eye mean std cov | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn keyword matlabFunction		error eval function | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn keyword matlabImplicit		abs acos atan asin cos cosh exp log prod sum | 
					
						
							| 
									
										
										
										
											2011-06-19 05:09:16 +02:00
										 |  |  | syn keyword matlabImplicit		log10 max min sign sin sinh sqrt tan reshape | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | syn match matlabError	"-\=\<\d\+\.\d\+\.[^*/\\^]" | 
					
						
							|  |  |  | syn match matlabError	"-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Define the default highlighting. | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Only when an item doesn't have highlighting yet | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | hi def link matlabTransposeOperator	matlabOperator | 
					
						
							|  |  |  | hi def link matlabOperator			Operator | 
					
						
							|  |  |  | hi def link matlabLineContinuation		Special | 
					
						
							|  |  |  | hi def link matlabLabel			Label | 
					
						
							|  |  |  | hi def link matlabConditional		Conditional | 
					
						
							|  |  |  | hi def link matlabExceptions		Conditional | 
					
						
							|  |  |  | hi def link matlabRepeat			Repeat | 
					
						
							|  |  |  | hi def link matlabTodo			Todo | 
					
						
							|  |  |  | hi def link matlabString			String | 
					
						
							| 
									
										
										
										
											2019-06-10 22:47:40 +02:00
										 |  |  | hi def link matlabStringArray			String | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link matlabDelimiter		Identifier | 
					
						
							|  |  |  | hi def link matlabTransposeOther		Identifier | 
					
						
							|  |  |  | hi def link matlabNumber			Number | 
					
						
							|  |  |  | hi def link matlabFloat			Float | 
					
						
							|  |  |  | hi def link matlabFunction			Function | 
					
						
							|  |  |  | hi def link matlabError			Error | 
					
						
							|  |  |  | hi def link matlabImplicit			matlabStatement | 
					
						
							|  |  |  | hi def link matlabStatement		Statement | 
					
						
							|  |  |  | hi def link matlabOO			Statement | 
					
						
							|  |  |  | hi def link matlabSemicolon		SpecialChar | 
					
						
							|  |  |  | hi def link matlabComment			Comment | 
					
						
							|  |  |  | hi def link matlabMultilineComment		Comment | 
					
						
							| 
									
										
										
										
											2017-01-28 18:34:47 +01:00
										 |  |  | hi def link matlabCellComment          Todo | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link matlabScope			Type | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | hi def link matlabArithmeticOperator	matlabOperator | 
					
						
							|  |  |  | hi def link matlabRelationalOperator	matlabOperator | 
					
						
							|  |  |  | hi def link matlabLogicalOperator		matlabOperator | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | "optional highlighting | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | "hi def link matlabIdentifier		Identifier | 
					
						
							|  |  |  | "hi def link matlabTab			Error | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "matlab" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | "EOF	vim: ts=8 noet tw=100 sw=8 sts=0 |