diff options
Diffstat (limited to 'syntax')
-rw-r--r-- | syntax/html.vim | 108 | ||||
-rw-r--r-- | syntax/html/aria.vim | 37 | ||||
-rw-r--r-- | syntax/html/rdfa.vim | 11 | ||||
-rw-r--r-- | syntax/javascript/html5.vim | 43 |
4 files changed, 199 insertions, 0 deletions
diff --git a/syntax/html.vim b/syntax/html.vim new file mode 100644 index 00000000..1cd86010 --- /dev/null +++ b/syntax/html.vim @@ -0,0 +1,108 @@ +" Vim syntax file +" Language: HTML (version 5) +" Maintainer: Rodrigo Machado <rcmachado@gmail.com> +" URL: http://rm.blog.br/vim/syntax/html.vim +" Last Change: 2009 Aug 19 +" License: Public domain +" (but let me know if you like :) ) +" +" Note: This file just adds the new tags from HTML 5 +" and don't replace default html.vim syntax file +" +" Modified: othree <othree@gmail.com> +" Changes: update to Draft 13 January 2011 +" add complete new attributes +" add microdata Attributes +" add bdi element +" Modified: htdebeer <H.T.de.Beer@gmail.com> +" Changes: add common SVG elements and attributes for inline SVG + +" HTML 5 tags +syn keyword htmlTagName contained article aside audio canvas command +syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer +syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav output +syn keyword htmlTagName contained progress ruby rt rp section source summary template time track video data +syn keyword htmlTagName contained wbr bdi + +" SVG tags +" http://www.w3.org/TR/SVG/ +" as found in http://www.w3.org/TR/SVG/eltindex.html +syn keyword htmlTagName contained svg +syn keyword htmlTagName contained altGlyph altGlyphDef altGlyphItem +syn keyword htmlTagName contained animate animateColor animateMotion animateTransform +syn keyword htmlTagName contained circle ellipse rect line polyline polygon image path +syn keyword htmlTagName contained clipPath color-profile cursor +syn keyword htmlTagName contained defs desc g symbol view use switch foreignObject +syn keyword htmlTagName contained filter feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence +syn keyword htmlTagName contained font font-face font-face-format font-face-name font-face-src font-face-uri +syn keyword htmlTagName contained glyph glyphRef hkern +syn keyword htmlTagName contained linearGradient marker mask pattern radialGradient set stop +syn keyword htmlTagName contained missing-glyph mpath +syn keyword htmlTagName contained text textPath tref tspan vkern + +" HTML 5 arguments +" Core Attributes +syn keyword htmlArg contained accesskey class contenteditable contextmenu dir +syn keyword htmlArg contained draggable hidden id lang spellcheck style tabindex title translate +" Event-handler Attributes +syn keyword htmlArg contained onabort onblur oncanplay oncanplaythrough onchange +syn keyword htmlArg contained onclick oncontextmenu ondblclick ondrag ondragend ondragenter ondragleave ondragover +syn keyword htmlArg contained ondragstart ondrop ondurationchange onemptied onended onerror onfocus onformchange +syn keyword htmlArg contained onforminput oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata +syn keyword htmlArg contained onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup +syn keyword htmlArg contained onmousewheel onpause onplay onplaying onprogress onratechange onreadystatechange +syn keyword htmlArg contained onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate +syn keyword htmlArg contained onvolumechange onwaiting +" XML Attributes +syn keyword htmlArg contained xml:lang xml:space xml:base xmlns +" new features +" <body> +syn keyword htmlArg contained onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload +syn keyword htmlArg contained onmessage onoffline ononline onpopstate onredo onresize onstorage onundo onunload +" <video>, <audio>, <source>, <track> +syn keyword htmlArg contained autoplay preload controls loop poster media kind charset srclang track +" <form>, <input>, <button> +syn keyword htmlArg contained form autocomplete autofocus list min max step +syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate +syn keyword htmlArg contained required placeholder +" <command>, <details>, <time> +syn keyword htmlArg contained label icon open datetime pubdate +" <script> +syn keyword htmlArg contained async + +" Custom Data Attributes +" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data +syn match htmlArg "\<\(data\(\-[a-z]\+\)\+\)\=\>" contained + +" Microdata +" http://dev.w3.org/html5/md/ +syn keyword htmlArg contained itemid itemscope itemtype itemprop itemref + +" SVG +" http://www.w3.org/TR/SVG/ +" Some common attributes from http://www.w3.org/TR/SVG/attindex.html +syn keyword htmlArg contained accent-height accumulate additive alphabetic amplitude arabic-form ascent attributeName attributeType azimuth +syn keyword htmlArg contained baseFrequency baseProfile bbox begin bias by +syn keyword htmlArg contained calcMode cap-height class clipPathUnits contentScriptType contentStyleType cx cy +syn keyword htmlArg contained d descent diffuseConstant divisor dur dx dy +syn keyword htmlArg contained edgeMode elevation end exponent externalResourcesRequired +syn keyword htmlArg contained fill filterRes filterUnits font-family font-size font-stretch font-style font-variant font-weight format format from fx fy +syn keyword htmlArg contained g1 g2 glyph-name glyphRef gradientTransform gradientUnits +syn keyword htmlArg contained hanging height horiz-adv-x horiz-origin-y +syn keyword htmlArg contained id ideographic in in2 intercept +syn keyword htmlArg contained k k1 k2 k3 k4 kernelMatrix kernelUnitLength keyPoints keySplines keyTimes +syn keyword htmlArg contained lang lengthAdjust limitingConeAngle local +syn keyword htmlArg contained markerHeight markerUnits markerWidth maskContentUnits maskUnits mathematical max media method min mode name +syn keyword htmlArg contained numOctaves +syn keyword htmlArg contained offset offset onabort onactivate onbegin onclick onend onerror onfocusin onfocusout onload onload onmousedown onmousemove onmouseout onmouseover onmouseup onrepeat onresize onscroll onunload onzoom operator order orient orientation origin overline-position overline-thickness +syn keyword htmlArg contained panose-1 path pathLength patternContentUnits patternTransform patternUnits points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits +syn keyword htmlArg contained r radius refX refY rendering-intent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry +syn keyword htmlArg contained scale seed slope spacing specularConstant specularExponent spreadMethod startOffset stdDeviation stemh stemv stitchTiles strikethrough-position strikethrough-thickness string surfaceScale systemLanguage +syn keyword htmlArg contained tableValues target targetX targetY textLength title to transform type u +syn keyword htmlArg contained 1 u2 underline-position underline-thickness unicode unicode-range units-per-em +syn keyword htmlArg contained v-alphabetic v-hanging v-ideographic v-mathematical values version vert-adv-y vert-origin-x vert-origin-y viewBox viewTarget +syn keyword htmlArg contained width widths +syn keyword htmlArg contained x x-height x1 x2 xChannelSelector xlink:actuate xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:show xlink:title xlink:type xml:base xml:lang xml:space +syn keyword htmlArg contained y y1 y2 yChannelSelector +syn keyword htmlArg contained z zoomAndPan +syn keyword htmlArg contained alignment-baseline baseline-shift clip-path clip-rule clip color-interpolation-filters color-interpolation color-profile color-rendering color cursor direction display dominant-baseline enable-background fill-opacity fill-rule fill filter flood-color flood-opacity font-family font-size-adjust font-size font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width stroke text-anchor text-decoration text-rendering unicode-bidi visibility word-spacing writing-mode diff --git a/syntax/html/aria.vim b/syntax/html/aria.vim new file mode 100644 index 00000000..64e972c7 --- /dev/null +++ b/syntax/html/aria.vim @@ -0,0 +1,37 @@ +" Vim syntax file +" Language: WAI-ARIA +" Maintainer: othree <othree@gmail.com> +" URL: http://github.com/othree/html5-syntax.vim +" Last Change: 2010-09-25 +" License: MIT +" Changes: update to Draft 16 September 2010 + +setlocal iskeyword+=- + +" WAI-ARIA States and Properties +" http://www.w3.org/TR/wai-aria/states_and_properties +syn keyword htmlArg contained role + +" Global States and Properties +syn keyword htmlArg contained aria-atomic aria-busy aria-controls aria-describedby +syn keyword htmlArg contained aria-disabled aria-dropeffect aria-flowto aria-grabbed +syn keyword htmlArg contained aria-haspopup aria-hidden aria-invalid aria-label +syn keyword htmlArg contained aria-labelledby aria-live aria-owns aria-relevant + +" Widget Attributes +syn keyword htmlArg contained aria-autocomplete aria-checked aria-disabled aria-expanded +syn keyword htmlArg contained aria-haspopup aria-hidden aria-invalid aria-label +syn keyword htmlArg contained aria-level aria-multiline aria-multiselectable aria-orientation +syn keyword htmlArg contained aria-pressed aria-readonly aria-required aria-selected +syn keyword htmlArg contained aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext + +" Live Region Attributes +syn keyword htmlArg contained aria-atomic aria-busy aria-live aria-relevant + +" Drag-and-Drop attributes +syn keyword htmlArg contained aria-dropeffect aria-grabbed + +" Relationship Attributes +syn keyword htmlArg contained aria-activedescendant aria-controls aria-describedby aria-flowto +syn keyword htmlArg contained aria-labelledby aria-owns aria-posinset aria-setsize + diff --git a/syntax/html/rdfa.vim b/syntax/html/rdfa.vim new file mode 100644 index 00000000..ca529d32 --- /dev/null +++ b/syntax/html/rdfa.vim @@ -0,0 +1,11 @@ +" Vim syntax file +" Language: RDFa +" Maintainer: othree <othree@gmail.com> +" URL: http://github.com/othree/html5-syntax.vim +" Last Change: 2012-06-08 +" License: MIT +" Changes: update to Rec 07 June 2012 + +" RDFa +" http://www.w3.org/TR/rdfa-syntax/#s_syntax +syn keyword htmlArg contained about content datatype href inlist prefix property rel resource rev src typeof vocab diff --git a/syntax/javascript/html5.vim b/syntax/javascript/html5.vim new file mode 100644 index 00000000..eaf84298 --- /dev/null +++ b/syntax/javascript/html5.vim @@ -0,0 +1,43 @@ +" Vim syntax file +" Language: HTML5 New Stuff +" Maintainer: othree <othree@gmail.com> +" URL: http://github.com/othree/html5-syntax.vim +" Last Change: 2011-05-27 +" License: MIT +" Changes: + +syn keyword javascriptHtmlEvents onabort onblur oncanplay oncanplaythrough onchange +syn keyword javascriptHtmlEvents onclick oncontextmenu ondblclick ondrag ondragend ondragenter ondragleave ondragover +syn keyword javascriptHtmlEvents ondragstart ondrop ondurationchange onemptied onended onerror onfocus onformchange +syn keyword javascriptHtmlEvents onforminput oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata +syn keyword javascriptHtmlEvents onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup +syn keyword javascriptHtmlEvents onmousewheel onpause onplay onplaying onprogress onratechange onreadystatechange +syn keyword javascriptHtmlEvents onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate +syn keyword javascriptHtmlEvents onvolumechange onwaiting + +" <body> +syn keyword javascriptHtmlEvents onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload +syn keyword javascriptHtmlEvents onmessage onoffline ononline onpopstate onredo onresize onstorage onundo onunload + +" Media Controller +syn keyword javascriptDomElemAttrs buffered seekable duration currentTime paused +syn keyword javascriptDomElemAttrs played defaultPlaybackRate playbackRate volume muted +syn keyword javascriptDomElemAttrs mediaGroup +syn keyword javascriptDomElemFuncs load play pause + +syn keyword javascriptHtmlEvents oncanplay oncanplaythrough ondurationchange onemptied +syn keyword javascriptHtmlEvents onloadeddata onloadedmetadata onloadstart onpause onplay onplaying onratechange +syn keyword javascriptHtmlEvents ontimeupdate onvolumechange onwaiting + +" <audio>/<video> +syn keyword javascriptDomElemAttrs error src currentSrc networkState preload buffered readyState seeking +syn keyword javascriptDomElemAttrs currentTime initialTime duration startOffsetTime paused defaultPlaybackRate playbackRate played +syn keyword javascriptDomElemAttrs seekable ended autoplay loop controls volume muted defaltMuted audioTracks videoTracks textTracks +syn keyword javascriptDomElemFuncs load addTextTrack + +" <video> +" syn keyword javascriptDomElemAttrs width height +syn keyword javascriptDomElemAttrs videoWidth videoHeight poster + +" drag and drop +syn keyword javascriptDomElemAttrs onDragStart onDragEnd onDragEnter onDragLeave onDragOver onDrag onDrop draggable dropzone |