Permalink
Browse files

Upgrade to match jQuery 1.6 keywords

  • Loading branch information...
1 parent ad90788 commit e6b8d78ce6766f4ed7dcc05306fd972ae1d5145a @nono committed May 4, 2011
Showing with 57 additions and 49 deletions.
  1. +2 −0 README.md
  2. +55 −49 syntax/jquery.vim
View
2 README.md
@@ -1,6 +1,8 @@
Vim syntax for jQuery
=====================
+It currently detects syntax and keywords for jQuery 1.6.
+
About
-----
View
104 syntax/jquery.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: jQuery
" Maintainer: Bruno Michel <brmichel@free.fr>
-" Last Change: Feb 2nd, 2010
-" Version: 0.4
-" URL: http://jquery.com/
+" Last Change: May 4th, 2011
+" Version: 0.5
+" URL: http://api.jquery.com/
if version < 600
syntax clear
@@ -23,40 +23,41 @@ syn match jQuery /jQuery\|\$/
syn match jFunc /\.\w\+(\@=/ contains=@jFunctions
-syn cluster jFunctions contains=jCore,jAttributes,jTraversing,jManipulation,jCSS,jEvents,jAjax,jUtilities,jEffects
-syn keyword jCore contained each size length selector context eq get index toArray
-syn keyword jCore contained data removeData clearQueue queue dequeue
-syn keyword jCore contained extend noConflict
-syn keyword jAttributes contained attr removeAttr addClass removeClass toggleClass html text val
-syn keyword jTraversing contained eq filter has is map not slice
-syn keyword jTraversing contained add children closest contents find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings
-syn keyword jTraversing contained andSelf end
-syn keyword jManipulation contained append appendTo preprend prependTo
-syn keyword jManipulation contained after before insertAfter insertBefore
+syn cluster jFunctions contains=jAjax,jAttributes,jCore,jCSS,jData,jDeferred,jDimensions,jEffects,jEvents,jManipulation,jMiscellaneous,jOffset,jProperties,jTraversing,jUtilities
+syn keyword jAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess
+syn keyword jAjax contained param serialize serializeArray
+syn keyword jAjax contained ajax ajaxPrefilter ajaxSetup ajaxSettings ajaxTransport
+syn keyword jAjax contained get getJSON getScript load post
+syn keyword jAttributes contained addClass attr hasClass prop removeAttr removeClass removeProp toggleClass val
+syn keyword jCore contained holdReady noConflict sub when
+syn keyword jCSS contained css cssHooks
+syn keyword jData contained clearQueue data dequeue hasData queue removeData
+syn keyword jDeferred contained Deferred always done fail isRejected isResolved pipe promise reject rejectWith resolved resolveWith then
+syn keyword jDimensions contained height innerHeight innerWidth outerHeight outerWidth width
+syn keyword jEffects contained hide show toggle
+syn keyword jEffects contained animate delay stop
+syn keyword jEffects contained fadeIn fadeOut fadeTo fadeToggle
+syn keyword jEffects contained slideDown slideToggle slideUp
+syn keyword jEvents contained error resize scroll
+syn keyword jEvents contained ready unload
+syn keyword jEvents contained bind delegate die live one proxy trigger triggerHandler unbind undelegate
+syn keyword jEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which
+syn keyword jEvents contained blur change focus select submit
+syn keyword jEvents contained focusin focusout keydown keypress keyup
+syn keyword jEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup
+syn keyword jManipulation contained clone
syn keyword jManipulation contained unwrap wrap wrapAll wrapInner
-syn keyword jManipulation contained replaceWith replaceAll
+syn keyword jManipulation contained append appendTo html preprend prependTo text
+syn keyword jManipulation contained after before insertAfter insertBefore
syn keyword jManipulation contained detach empty remove
-syn keyword jManipulation contained clone
-syn keyword jCSS contained css
-syn keyword jCSS contained offset offsetParent position scrollTop scrollLeft
-syn keyword jCSS contained height width innerHeight innerWidth outerHeight outerWidth
-syn keyword jEvents contained ready
-syn keyword jEvents contained bind one trigger triggerHandler unbind
-syn keyword jEvents contained live die
-syn keyword jEvents contained hover toggle
-syn keyword jEvents contained blur change click dblclick error focus focusin focusout keydown keypress keyup load
-syn keyword jEvents contained mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup resize scroll select submit unload
-syn keyword jEffects contained show hide toggle
-syn keyword jEffects contained slideDown slideUp slideToggle
-syn keyword jEffects contained fadeIn fadeOut fadeTo
-syn keyword jEffects contained animate stop delay
-syn keyword jAjax contained ajax load get getJSON getScript post
-syn keyword jAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess
-syn keyword jAjax contained ajaxSetup serialize serializeArray
-syn keyword jUtilities contained support browser boxModel
-syn keyword jUtilities contained extend grep makeArray map inArray merge noop proxy unique
-syn keyword jUtilities contained isArray isEmptyObject isFunction isPlainObject
-syn keyword jUtilities contained trim param
+syn keyword jManipulation contained replaceAll replaceWith
+syn keyword jMiscellaneous contained index size toArray
+syn keyword jOffset contained offset offsetParent position scrollTop scrollLeft
+syn keyword jProperties contained browser context fx.interval fx.off length selector support
+syn keyword jTraversing contained eq filter first has is last map not slice
+syn keyword jTraversing contained add andSelf contents end
+syn keyword jTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings
+syn keyword jUtilities contained contains each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray merge noop now parseJSON parseXML trim type unique
syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc,@jSelectors
@@ -65,13 +66,12 @@ syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+
syn cluster jSelectors contains=jId,jClass,jOperators,jBasicFilters,jContentFilters,jVisibility,jChildFilters,jForms,jFormFilters
syn match jId contained /#[0-9A-Za-z_\-]\+/
syn match jClass contained /\.[0-9A-Za-z_\-]\+/
-syn match jOperators contained /*\|>\|>|\~/
-syn match jBasicFilters contained /:\(first\|last\|not\|even\|odd\|eq\|gt\|lt\|header\|animated\)/
+syn match jOperators contained /*\|>\|+\|-\|~/
+syn match jBasicFilters contained /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lt\|not\|odd\)/
+syn match jChildFilters contained /:\(first\|last\|nth\|only\)-child/
syn match jContentFilters contained /:\(contains\|empty\|has\|parent\)/
+syn match jForms contained /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/
syn match jVisibility contained /:\(hidden\|visible\)/
-syn match jChildFilters contained /:\(nth\|first\|last\|only\)-child/
-syn match jForms contained /:\(input\|text\|password\|radio\|checkbox\|submit\|image\|reset\|button\|file\)/
-syn match jFormFilters contained /:\(enabled\|disabled\|checked\|selected\)/
" Define the default highlighting.
@@ -87,15 +87,21 @@ if version >= 508 || !exists("did_lisp_syntax_inits")
HiLink jQuery Constant
- HiLink jCore Identifier
- HiLink jAttributes Identifier
- HiLink jTraversing Identifier
- HiLink jManipulation Identifier
- HiLink jCSS Identifier
- HiLink jEvents Identifier
- HiLink jEffects Identifier
- HiLink jAjax Identifier
- HiLink jUtilities Identifier
+ HiLink jAjax Function
+ HiLink jAttributes Function
+ HiLink jCore Function
+ HiLink jCSS Function
+ HiLink jData Function
+ HiLink jDeferred Function
+ HiLink jDimensions Function
+ HiLink jEffects Function
+ HiLink jEvents Function
+ HiLink jManipulation Function
+ HiLink jMiscellaneous Function
+ HiLink jOffset Function
+ HiLink jProperties Function
+ HiLink jTraversing Function
+ HiLink jUtilities Function
HiLink jId Identifier
HiLink jClass Constant

0 comments on commit e6b8d78

Please sign in to comment.