251 lines · 17.4 KB · Text
RawDownload
" Vim syntax file"    Language: ColdFusion"  Maintainer: Toby Woodwark (toby.woodwark+vim@gmail.com)" Last Change: 2005 Nov 25"   Filenames: *.cfc *.cfm"     Version: Macromedia ColdFusion MX 7"       Usage: Note that ColdFusion has its own comment syntax"              i.e. <!--- ---> " For version 5.x, clear all syntax items." For version 6.x+, quit if a syntax file is already loaded.if version < 600  syntax clearelseif exists("b:current_syntax")  finishendif " Use all the stuff from the HTML syntax file." TODO remove this; CFML is not a superset of HTMLif version < 600  source <sfile>:p:h/html.vimelse  runtime! syntax/html.vimendif syn sync fromstartsyn sync maxlines=200syn case ignore " Scopes and keywords.syn keyword cfScope contained cgi cffile request caller this thistag cfcatch variables application server session client form url attributes argumentssyn keyword cfBool contained yes no true false " Operator strings." Not exhaustive, since there are longhand equivalents.syn keyword cfOperator contained xor eqv and or lt le lte gt ge gte eq neq not is mod containssyn match cfOperatorMatch contained "[\+\-\*\/\\\^\&][\+\-\*\/\\\^\&]\@!"syn cluster cfOperatorCluster contains=cfOperator,cfOperatorMatch " Tag names.syn keyword cfTagName contained cfabort cfapplet cfapplication cfargument cfassociate cfbreak cfcachesyn keyword cfTagName contained cfcalendar cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollectionsyn keyword cfTagName contained cfcomponent cfcontent cfcookie cfdefaultcase cfdirectory cfdocumentsyn keyword cfTagName contained cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror cfexecutesyn keyword cfTagName contained cfexit cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgridsyn keyword cfTagName contained cfgridcolumn cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfifsyn keyword cfTagName contained cfimport cfinclude cfindex cfinput cfinsert cfinvoke cfinvokeargumentsyn keyword cfTagName contained cfldap cflocation cflock cflog cflogin cfloginuser cflogout cfloop cfmailsyn keyword cfTagName contained cfmailparam cfmailpart cfmodule cfNTauthenticate cfobject cfobjectcachesyn keyword cfTagName contained cfoutput cfparam cfpop cfprocessingdirective cfprocparam cfprocresultsyn keyword cfTagName contained cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrowsyn keyword cfTagName contained cfreturn cfsavecontent cfschedule cfscript cfsearch cfselect cfset cfsettingsyn keyword cfTagName contained cfsilent cfslider cfstoredproc cfswitch cftable cftextarea cfthrow cftimersyn keyword cfTagName contained cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx cfxml  " Tag parameters.syn keyword cfArg contained abort accept access accessible action addnewline addtoken addtoken agentnamesyn keyword cfArg contained align appendkey appletsource application applicationtimeout applicationtokensyn keyword cfArg contained archive argumentcollection arguments asciiextensionlist attachmentpathsyn keyword cfArg contained attributecollection attributes attributes autowidth backgroundcolorsyn keyword cfArg contained backgroundvisible basetag bcc bgcolor bind bindingname blockfactor body boldsyn keyword cfArg contained border branch cachedafter cachedwithin casesensitive categories categorysyn keyword cfArg contained categorytree cc cfsqltype charset chartheight chartwidth checked classsyn keyword cfArg contained clientmanagement clientstorage codebase colheaderalign colheaderboldsyn keyword cfArg contained colheaderfont colheaderfontsize colheaderitalic colheaders colheadertextcolorsyn keyword cfArg contained collection colorlist colspacing columns completepath component conditionsyn keyword cfArg contained connection contentid context contextbytes contexthighlightbeginsyn keyword cfArg contained contexthighlightend contextpassages cookiedomain criteria custom1 custom2syn keyword cfArg contained custom3 custom4 data dataalign databackgroundcolor datacollectionsyn keyword cfArg contained datalabelstyle datasource date daynames dbname dbserver dbtype dbvarname debugsyn keyword cfArg contained default delete deletebutton deletefile delimiter delimiters descriptionsyn keyword cfArg contained destination detail directory disabled display displayname disposition dn domainsyn keyword cfArg contained enablecab enablecfoutputonly enabled encoded encryption enctype enddatesyn keyword cfArg contained endrange endrow endtime entry errorcode exception existing expand expiressyn keyword cfArg contained expireurl expression extendedinfo extends extensions external failifexistssyn keyword cfArg contained failto file filefield filename filter firstdayofweek firstrowasheaders fontsyn keyword cfArg contained fontbold fontembed fontitalic fontsize foregroundcolor format formfieldssyn keyword cfArg contained formula from generateuniquefilenames getasbinary grid griddataalign gridlinessyn keyword cfArg contained groovecolor group groupcasesensitive header headeralign headerbold headerfontsyn keyword cfArg contained headerfontsize headeritalic headerlines headertextcolor height highlighthrefsyn keyword cfArg contained hint href hrefkey hscroll hspace htmltable id idletimeout img imgopen imgstylesyn keyword cfArg contained index inline input insert insertbutton interval isolation italic itemsyn keyword cfArg contained itemcolumn key keyonly label labelformat language list listgroups localesyn keyword cfArg contained localfile log loginstorage lookandfeel mailerid mailto marginbottom marginleftsyn keyword cfArg contained marginright marginright margintop markersize markerstyle mask maxlength maxrowssyn keyword cfArg contained message messagenumber method mimeattach mimetype mode modifytype monthnamessyn keyword cfArg contained multipart multiple name namecomplict nameconflict namespace new newdirectorysyn keyword cfArg contained notsupported null numberformat object omit onchange onclick onerror onkeydownsyn keyword cfArg contained onkeyup onload onmousedown onmouseup onreset onsubmit onvalidate operationsyn keyword cfArg contained orderby orientation output outputfile overwrite ownerpassword pageencodingsyn keyword cfArg contained pageheight pagetype pagewidth paintstyle param_1 param_2 param_3 param_4syn keyword cfArg contained param_5 parent passive passthrough password path pattern permissions picturebarsyn keyword cfArg contained pieslicestyle port porttypename prefix preloader preservedata previouscriteriasyn keyword cfArg contained procedure protocol provider providerdsn proxybypass proxypassword proxyportsyn keyword cfArg contained proxyserver proxyuser publish query queryasroot queryposition range rebindsyn keyword cfArg contained recurse redirect referral refreshlabel remotefile replyto report requesttimeoutsyn keyword cfArg contained required reset resolveurl result resultset retrycount returnasbinary returncodesyn keyword cfArg contained returntype returnvariable roles rowheaderalign rowheaderbold rowheaderfontsyn keyword cfArg contained rowheaderfontsize rowheaderitalic rowheaders rowheadertextcolor rowheaderwidthsyn keyword cfArg contained rowheight scale scalefrom scaleto scope scriptprotect scriptsrc securesyn keyword cfArg contained securitycontext select selectcolor selected selecteddate selectedindexsyn keyword cfArg contained selectmode separator seriescolor serieslabel seriesplacement server serviceportsyn keyword cfArg contained serviceportname sessionmanagement sessiontimeout setclientcookies setcookiesyn keyword cfArg contained setdomaincookies show3d showborder showdebugoutput showerror showlegendsyn keyword cfArg contained showmarkers showxgridlines showygridlines size skin sort sortascendingbuttonsyn keyword cfArg contained sortcontrol sortdescendingbutton sortxaxis source spoolenable sql src startsyn keyword cfArg contained startdate startrange startrow starttime status statuscode statustext stepsyn keyword cfArg contained stoponerror style subject suggestions suppresswhitespace tablename tableownersyn keyword cfArg contained tablequalifier taglib target task template text textcolor textqualifiersyn keyword cfArg contained thread throwonerror throwonfailure throwontimeout time timeout timespan tipbgcolor tipstylesyn keyword cfArg contained title to tooltip top toplevelvariable transfermode type uid unit url urlpathsyn keyword cfArg contained useragent username userpassword usetimezoneinfo validate validateat valuesyn keyword cfArg contained valuecolumn values valuesdelimiter valuesdisplay var variable vertical visiblesyn keyword cfArg contained vscroll vspace webservice width wmode wraptext wsdlfile xaxistitle xaxistypesyn keyword cfArg contained xoffset yaxistitle yaxistype yoffset " ColdFusion Functions.syn keyword cfFunctionName contained Abs GetFunctionList Max ACos GetGatewayHelper Mid AddSOAPRequestHeadersyn keyword cfFunctionName contained GetHttpRequestData Min AddSOAPResponseHeader GetHttpTimeString Minutesyn keyword cfFunctionName contained ArrayAppend GetLocale Month ArrayAvg GetLocaleDisplayName MonthAsStringsyn keyword cfFunctionName contained ArrayClear GetMetaData Now ArrayDeleteAt GetMetricData NumberFormatsyn keyword cfFunctionName contained ArrayInsertAt GetPageContext ParagraphFormat ArrayIsEmpty GetProfileSectionssyn keyword cfFunctionName contained ParseDateTime ArrayLen GetProfileString Pi ArrayMax GetSOAPRequestsyn keyword cfFunctionName contained PreserveSingleQuotes ArrayMin GetSOAPRequestHeader Quarter ArrayNewsyn keyword cfFunctionName contained GetSOAPResponse QueryAddColumn ArrayPrepend GetSOAPResponseHeader QueryAddRowsyn keyword cfFunctionName contained ArrayResize GetTempDirectory QueryNew ArraySet GetTempFile QuerySetCellsyn keyword cfFunctionName contained ArraySort GetTickCount QuotedValueList ArraySum GetTimeZoneInfo Rand ArraySwapsyn keyword cfFunctionName contained GetToken Randomize ArrayToList Hash RandRange Asc Hour REFind ASinsyn keyword cfFunctionName contained HTMLCodeFormat REFindNoCase Atn HTMLEditFormat ReleaseComObject BinaryDecodesyn keyword cfFunctionName contained IIf RemoveChars BinaryEncode IncrementValue RepeatString BitAnd InputBaseNsyn keyword cfFunctionName contained Replace BitMaskClear Insert ReplaceList BitMaskRead Int ReplaceNoCasesyn keyword cfFunctionName contained BitMaskSet IsArray REReplace BitNot IsBinary REReplaceNoCase BitOr IsBooleansyn keyword cfFunctionName contained Reverse BitSHLN IsCustomFunction Right BitSHRN IsDate RJustify BitXorsyn keyword cfFunctionName contained IsDebugMode Round Ceiling IsDefined RTrim CharsetDecode IsLeapYear Secondsyn keyword cfFunctionName contained CharsetEncode IsNumeric SendGatewayMessage Chr IsNumericDate SetEncodingsyn keyword cfFunctionName contained CJustify IsObject SetLocale Compare IsQuery SetProfileString CompareNoCasesyn keyword cfFunctionName contained IsSimpleValue SetVariable Cos IsSOAPRequest Sgn CreateDate IsStruct Sinsyn keyword cfFunctionName contained CreateDateTime IsUserInRole SpanExcluding CreateObject IsValid SpanIncludingsyn keyword cfFunctionName contained CreateODBCDate IsWDDX Sqr CreateODBCDateTime IsXML StripCR CreateODBCTimesyn keyword cfFunctionName contained IsXmlAttribute StructAppend CreateTime IsXmlDoc StructClear CreateTimeSpansyn keyword cfFunctionName contained IsXmlElem StructCopy CreateUUID IsXmlNode StructCount DateAdd IsXmlRootsyn keyword cfFunctionName contained StructDelete DateCompare JavaCast StructFind DateConvert JSStringFormatsyn keyword cfFunctionName contained StructFindKey DateDiff LCase StructFindValue DateFormat Left StructGetsyn keyword cfFunctionName contained DatePart Len StructInsert Day ListAppend StructIsEmpty DayOfWeeksyn keyword cfFunctionName contained ListChangeDelims StructKeyArray DayOfWeekAsString ListContains StructKeyExistssyn keyword cfFunctionName contained DayOfYear ListContainsNoCase StructKeyList DaysInMonth ListDeleteAt StructNewsyn keyword cfFunctionName contained DaysInYear ListFind StructSort DE ListFindNoCase StructUpdate DecimalFormatsyn keyword cfFunctionName contained ListFirst Tan DecrementValue ListGetAt TimeFormat Decrypt ListInsertAtsyn keyword cfFunctionName contained ToBase64 DeleteClientVariable ListLast ToBinary DirectoryExists ListLensyn keyword cfFunctionName contained ToScript DollarFormat ListPrepend ToString Duplicate ListQualify Trim Encryptsyn keyword cfFunctionName contained ListRest UCase Evaluate ListSetAt URLDecode Exp ListSort URLEncodedFormatsyn keyword cfFunctionName contained ExpandPath ListToArray URLSessionFormat FileExists ListValueCount Val Findsyn keyword cfFunctionName contained ListValueCountNoCase ValueList FindNoCase LJustify Week FindOneOf Log Wrapsyn keyword cfFunctionName contained FirstDayOfMonth Log10 WriteOutput Fix LSCurrencyFormat XmlChildPos FormatBaseNsyn keyword cfFunctionName contained LSDateFormat XmlElemNew GetTempDirectory LSEuroCurrencyFormat XmlFormatsyn keyword cfFunctionName contained GetAuthUser LSIsCurrency XmlGetNodeType GetBaseTagData LSIsDate XmlNewsyn keyword cfFunctionName contained GetBaseTagList LSIsNumeric XmlParse GetBaseTemplatePath LSNumberFormatsyn keyword cfFunctionName contained XmlSearch GetClientVariablesList LSParseCurrency XmlTransformsyn keyword cfFunctionName contained GetCurrentTemplatePath LSParseDateTime XmlValidate GetDirectoryFromPathsyn keyword cfFunctionName contained LSParseEuroCurrency Year GetEncoding LSParseNumber YesNoFormat GetExceptionsyn keyword cfFunctionName contained LSTimeFormat GetFileFromPath LTrim  syn cluster htmlTagNameCluster add=cfTagNamesyn cluster htmlArgCluster add=cfArg,cfHashRegion,cfScopesyn cluster htmlPreproc add=cfHashRegion syn cluster cfExpressionCluster contains=cfFunctionName,cfScope,@cfOperatorCluster,cfScriptStringD,cfScriptStringS,cfScriptNumber,cfBool " Evaluation; skip strings ( this helps with cases like nested IIf() )syn region cfHashRegion start=+#+ skip=+"[^"]*"\|'[^']*'+ end=+#+ contains=@cfExpressionCluster,cfScriptParenError " <cfset>, <cfif>, <cfelseif>, <cfreturn> are analogous to hashmarks (implicit evaluation) and has 'var'syn region cfSetRegion start="<cfset " start="<cfreturn " start="<cfelseif " start="<cfif " end='>' keepend contains=@cfExpressionCluster,cfSetLHSRegion,cfSetTagEnd,cfScriptTypesyn region cfSetLHSRegion contained start="<cfreturn" start="<cfelseif" start="<cfif" start="<cfset" end=" " keepend contains=cfTagName,htmlTagsyn match  cfSetTagEnd contained '>' " CF comments: similar to SGML commentssyn region  cfComment     start='<!---' end='--->' keepend contains=cfCommentTodosyn keyword cfCommentTodo contained TODO FIXME XXX TBD WTF  " CFscript syn match   cfScriptLineComment      contained "\/\/.*$" contains=cfCommentTodosyn region  cfScriptComment	     contained start="/\*"  end="\*/" contains=cfCommentTodo" in CF, quotes are escaped by doublingsyn region  cfScriptStringD	     contained start=+"+  skip=+\\\\\|""+  end=+"+  extend contains=@htmlPreproc,cfHashRegionsyn region  cfScriptStringS	     contained start=+'+  skip=+\\\\\|''+  end=+'+  extend contains=@htmlPreproc,cfHashRegionsyn match   cfScriptNumber	     contained "-\=\<\d\+L\=\>"syn keyword cfScriptConditional      contained if elsesyn keyword cfScriptRepeat	     contained while for insyn keyword cfScriptBranch	     contained break switch case try catch continuesyn keyword cfScriptFunction	     contained functionsyn keyword cfScriptType	     contained varsyn match   cfScriptBraces	     contained "[{}]"syn keyword cfScriptStatement        contained return syn cluster cfScriptCluster contains=cfScriptParen,cfScriptLineComment,cfScriptComment,cfScriptStringD,cfScriptStringS,cfScriptFunction,cfScriptNumber,cfScriptRegexpString,cfScriptBoolean,cfScriptBraces,cfHashRegion,cfFunctionName,cfScope,@cfOperatorCluster,cfScriptConditional,cfScriptRepeat,cfScriptBranch,cfScriptType,@cfExpressionCluster,cfScriptStatement " Errors caused by wrong parenthesis; skip stringssyn region  cfScriptParen       contained transparent skip=+"[^"]*"\|'[^']*'+ start=+(+ end=+)+ contains=@cfScriptClustersyn match   cfScrParenError 	contained +)+ syn region cfscriptBlock matchgroup=NONE start="<cfscript>"  end="<\/cfscript>"me=s-1 keepend contains=@cfScriptCluster,cfscriptTag,cfScrParenErrorsyn region  cfscriptTag contained start='<cfscript' end='>' keepend contains=cfTagName,htmlTag " Define the default highlighting.if version >= 508 || !exists("did_cf_syn_inits")  if version < 508    let did_cf_syn_inits = 1    command -nargs=+ HiLink hi link <args>  else    command -nargs=+ HiLink hi def link <args>  endif   HiLink cfTagName 		Statement  HiLink cfArg 			Type  HiLink cfFunctionName 	Function  HiLink cfHashRegion 		PreProc  HiLink cfComment 		Comment  HiLink cfCommentTodo 		Todo  HiLink cfOperator		Operator  HiLink cfOperatorMatch	Operator  HiLink cfScope		Title  HiLink cfBool			Constant   HiLink cfscriptBlock 		Special  HiLink cfscriptTag 		htmlTag  HiLink cfSetRegion 		PreProc  HiLink cfSetLHSRegion 	htmlTag  HiLink cfSetTagEnd		htmlTag   HiLink cfScriptLineComment	Comment  HiLink cfScriptComment	Comment  HiLink cfScriptStringS	String  HiLink cfScriptStringD	String  HiLink cfScriptNumber	     	cfScriptValue  HiLink cfScriptConditional	Conditional  HiLink cfScriptRepeat	     	Repeat  HiLink cfScriptBranch	     	Conditional  HiLink cfScriptType		Type  HiLink cfScriptStatement	Statement  HiLink cfScriptBraces	     	Function  HiLink cfScriptFunction    	Function  HiLink cfScriptError	     	Error  HiLink cfScrParenError	cfScriptError   delcommand HiLinkendif let b:current_syntax = "cf" " vim: ts=8 sw=2