|
| 1 | +" Vim syntax file |
| 2 | +" Language: HTML (version 5) |
| 3 | +" Maintainer: Rodrigo Machado <[email protected]> |
| 4 | +" URL: http://rm.blog.br/vim/syntax/html.vim |
| 5 | +" Last Change: 2009 Aug 19 |
| 6 | +" License: Public domain |
| 7 | +" (but let me know if you like :) ) |
| 8 | +" |
| 9 | +" Note: This file just adds the new tags from HTML 5 |
| 10 | +" and don't replace default html.vim syntax file |
| 11 | +" |
| 12 | +" Modified: othree <[email protected]> |
| 13 | +" Changes: update to Draft 28 August 2010 |
| 14 | +" add complete new attributes |
| 15 | +" add wai-aria attributes |
| 16 | +" add microdata attributes |
| 17 | +" add rdfa attributes |
| 18 | + |
| 19 | + |
| 20 | +syn keyword htmlTagName contained script |
| 21 | +" HTML 5 tags |
| 22 | +syn keyword htmlTagName contained article aside audio canvas command |
| 23 | +syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer |
| 24 | +syn keyword htmlTagName contained header hgroup keygen mark meter menu nav output |
| 25 | +syn keyword htmlTagName contained progress time ruby rt rp section source summary time track video wbr |
| 26 | + |
| 27 | +" HTML 5 arguments |
| 28 | +" Core Attributes |
| 29 | +syn keyword htmlArg contained accesskey class contenteditable contextmenu dir |
| 30 | +syn keyword htmlArg contained draggable hidden id lang spellcheck style tabindex title |
| 31 | +" Event-handler Attributes |
| 32 | +syn keyword htmlArg contained onabort onblur oncanplay oncanplaythrough onchange |
| 33 | +syn keyword htmlArg contained onclick oncontextmenu ondblclick ondrag ondragend ondragenter ondragleave ondragover |
| 34 | +syn keyword htmlArg contained ondragstart ondrop ondurationchange onemptied onended onerror onfocus onformchange |
| 35 | +syn keyword htmlArg contained onforminput oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata |
| 36 | +syn keyword htmlArg contained onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup |
| 37 | +syn keyword htmlArg contained onmousewheel onpause onplay onplaying onprogress onratechange onreadystatechange |
| 38 | +syn keyword htmlArg contained onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate |
| 39 | +syn keyword htmlArg contained onvolumechange onwaiting |
| 40 | +" XML Attributes |
| 41 | +syn keyword htmlArg contained xml:lang xml:space xml:base |
| 42 | +" new features |
| 43 | +" <body> |
| 44 | +syn keyword htmlArg contained onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload |
| 45 | +syn keyword htmlArg contained onmessage onoffline ononline onpopstate onredo onresize onstorage onundo onunload |
| 46 | +" <video>, <audio>, <source>, <track> |
| 47 | +syn keyword htmlArg contained autoplay preload controls loop poster media kind charset srclang track |
| 48 | +" <form>, <input>, <button> |
| 49 | +syn keyword htmlArg contained form autocomplete autofocus list min max step |
| 50 | +syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate |
| 51 | +" <command>, <details>, <time> |
| 52 | +syn keyword htmlArg contained label icon open datetime pubdate |
| 53 | + |
| 54 | +" Custom Data Attributes |
| 55 | +" http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute |
| 56 | +syn match htmlArg "\<\(data(\-[a-z]\+)\+\)=" contained |
| 57 | + |
| 58 | +" Microdata |
| 59 | +" http://dev.w3.org/html5/md/ |
| 60 | +syn keyword htmlArg contained item itemid itemscope itemtype itemprop |
| 61 | + |
| 62 | +" RDFa |
| 63 | +" http://www.w3.org/TR/rdfa-syntax/#a_xhtmlrdfa_dtd |
| 64 | +syn keyword htmlArg contained about typeof property resource content datatype rel rev |
| 65 | + |
| 66 | +" WAI-ARIA States and Properties |
| 67 | +" http://www.w3.org/TR/wai-aria/states_and_properties |
| 68 | +syn keyword htmlArg contained role |
| 69 | +" Global States and Properties |
| 70 | +syn match htmlArg contained "\<aria-\(atomic\|busy\|controls\|describedby\)\>" |
| 71 | +syn match htmlArg contained "\<aria-\(disabled\|dropeffect\|flowto\|grabbed\)\>" |
| 72 | +syn match htmlArg contained "\<aria-\(haspopup\|hidden\|invalid\|label\)\>" |
| 73 | +syn match htmlArg contained "\<aria-\(labelledby\|live\|owns\|relevant\)\>" |
| 74 | + |
| 75 | +" Widget Attributes |
| 76 | +syn match htmlArg contained "\<aria-\(autocomplete\|checked\|disabled\|expanded\)\>" |
| 77 | +syn match htmlArg contained "\<aria-\(haspopup\|hidden\|invalid\|label\)\>" |
| 78 | +syn match htmlArg contained "\<aria-\(level\|multiline\|multiselectable\|orientation\)\>" |
| 79 | +syn match htmlArg contained "\<aria-\(pressed\|readonly\|required\|selected\)\>" |
| 80 | +syn match htmlArg contained "\<aria-\(sort\|valuemax\|valuemin\|valuenow\|valuetext\|\)\>" |
| 81 | + |
| 82 | +" Live Region Attributes |
| 83 | +syn match htmlArg contained "\<aria-\(atomic\|busy\|live\|relevant\|\)\>" |
| 84 | + |
| 85 | +" Drag-and-Drop attributes |
| 86 | +syn match htmlArg contained "\<aria-\(dropeffect\|grabbed\)\>" |
| 87 | + |
| 88 | +" Relationship Attributes |
| 89 | +syn match htmlArg contained "\<aria-\(activedescendant\|controls\|describedby\|flowto\|\)\>" |
| 90 | +syn match htmlArg contained "\<aria-\(labelledby\|owns\|posinset\|setsize\|\)\>" |
0 commit comments