154 lines · 6.0 KB · Text
RawDownload
" Vim syntax file" Language:	C#" Maintainer:	Anduin Withers <awithers@anduin.com>" Former Maintainer:	Johannes Zellner <johannes@zellner.org>" Last Change:	Sun Apr 30 19:26:18 PDT 2006" Filenames:	*.cs" $Id: cs.vim,v 1.4 2006/05/03 21:20:02 vimboss Exp $"" REFERENCES:" [1] ECMA TC39: C# Language Specification (WD13Oct01.doc) if exists("b:current_syntax")    finishendif let s:cs_cpo_save = &cposet cpo&vim  " typesyn keyword csType			bool byte char decimal double float int long object sbyte short string uint ulong ushort void" storagesyn keyword csStorage			class delegate enum interface namespace struct" repeat / condition / labelsyn keyword csRepeat			break continue do for foreach goto return whilesyn keyword csConditional		else if switchsyn keyword csLabel			case default" there's no :: operator in C#syn match csOperatorError		display +::+" user labels (see [1] 8.6 Statements)syn match   csLabel			display +^\s*\I\i*\s*:\([^:]\)\@=+" modifiersyn keyword csModifier			abstract const extern internal override private protected public readonly sealed static virtual volatile" constantsyn keyword csConstant			false null true" exceptionsyn keyword csException			try catch finally throw " TODO:syn keyword csUnspecifiedStatement	as base checked event fixed in is lock new operator out params ref sizeof stackalloc this typeof unchecked unsafe using" TODO:syn keyword csUnsupportedStatement	add remove value" TODO:syn keyword csUnspecifiedKeyword	explicit implicit  " Contextual Keywordssyn match csContextualStatement	/\<yield[[:space:]\n]\+\(return\|break\)/me=s+5syn match csContextualStatement	/\<partial[[:space:]\n]\+\(class\|struct\|interface\)/me=s+7syn match csContextualStatement	/\<\(get\|set\)[[:space:]\n]*{/me=s+3syn match csContextualStatement	/\<where\>[^:]\+:/me=s+5 " Comments"" PROVIDES: @csCommentHook"" TODO: include strings ?"syn keyword csTodo		contained TODO FIXME XXX NOTEsyn region  csComment		start="/\*"  end="\*/" contains=@csCommentHook,csTodo,@Spellsyn match   csComment		"//.*$" contains=@csCommentHook,csTodo,@Spell " xml markup inside '///' commentssyn cluster xmlRegionHook	add=csXmlCommentLeadersyn cluster xmlCdataHook	add=csXmlCommentLeadersyn cluster xmlStartTagHook	add=csXmlCommentLeadersyn keyword csXmlTag		contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryNamesyn keyword csXmlTag		contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfosyn keyword csXmlTag		contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Basesyn keyword csXmlTag		contained BaseTypeName Interfaces Interface InterfaceName Attributes Attributesyn keyword csXmlTag		contained AttributeName Members Member MemberSignature MemberType MemberValuesyn keyword csXmlTag		contained ReturnValue ReturnType Parameters Parameter MemberOfPackagesyn keyword csXmlTag		contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summarysyn keyword csXmlTag		contained threadsafe value internalonly nodoc exception param permission platnotesyn keyword csXmlTag		contained seealso b c i pre sub sup block code note paramref see subscript superscriptsyn keyword csXmlTag		contained list listheader item term description altcompliant altmember syn cluster xmlTagHook add=csXmlTag syn match   csXmlCommentLeader	+\/\/\/+    containedsyn match   csXmlComment	+\/\/\/.*$+ contains=csXmlCommentLeader,@csXmlsyntax include @csXml <sfile>:p:h/xml.vimhi def link xmlRegion Comment  " [1] 9.5 Pre-processing directivessyn region	csPreCondit    \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)"    \ skip="\\$" end="$" contains=csComment keependsyn region	csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$"    \ end="^\s*#\s*endregion" transparent fold contains=TOP   " Strings and constantssyn match   csSpecialError	contained "\\."syn match   csSpecialCharError	contained "[^']"" [1] 9.4.4.4 Character literalssyn match   csSpecialChar	contained +\\["\\'0abfnrtvx]+" unicode characterssyn match   csUnicodeNumber	+\\\(u\x\{4}\|U\x\{8}\)+ contained contains=csUnicodeSpecifiersyn match   csUnicodeSpecifier	+\\[uU]+ containedsyn region  csVerbatimString	start=+@"+ end=+"+ end=+$+ skip=+""+ contains=csVerbatimSpec,@Spellsyn match   csVerbatimSpec	+@"+he=s+1 containedsyn region  csString		start=+"+  end=+"+ end=+$+ contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spellsyn match   csCharacter		"'[^']*'" contains=csSpecialChar,csSpecialCharErrorsyn match   csCharacter		"'\\''" contains=csSpecialCharsyn match   csCharacter		"'[^\\]'"syn match   csNumber		"\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"syn match   csNumber		"\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="syn match   csNumber		"\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"syn match   csNumber		"\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" " The default highlighting.hi def link csType			Typehi def link csStorage			StorageClasshi def link csRepeat			Repeathi def link csConditional		Conditionalhi def link csLabel			Labelhi def link csModifier			StorageClasshi def link csConstant			Constanthi def link csException			Exceptionhi def link csUnspecifiedStatement	Statementhi def link csUnsupportedStatement	Statementhi def link csUnspecifiedKeyword	Keywordhi def link csContextualStatement	Statementhi def link csOperatorError		Error hi def link csTodo			Todohi def link csComment			Comment hi def link csSpecialError		Errorhi def link csSpecialCharError		Errorhi def link csString			Stringhi def link csVerbatimString		Stringhi def link csVerbatimSpec		SpecialCharhi def link csPreCondit			PreCondithi def link csCharacter			Characterhi def link csSpecialChar		SpecialCharhi def link csNumber			Numberhi def link csUnicodeNumber		SpecialCharhi def link csUnicodeSpecifier		SpecialChar " xml markuphi def link csXmlCommentLeader		Commenthi def link csXmlComment		Commenthi def link csXmlTag			Statement let b:current_syntax = "cs" let &cpo = s:cs_cpo_saveunlet s:cs_cpo_save " vim: ts=8