Skip to content

Instantly share code, notes, and snippets.

@changemewtf
Created September 30, 2011 20:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save changemewtf/1254928 to your computer and use it in GitHub Desktop.
Save changemewtf/1254928 to your computer and use it in GitHub Desktop.
Add new HTML5 tags to vim indent & syntax files.
diff -r ba9f075a347d runtime/indent/html.vim
--- a/runtime/indent/html.vim Sun Aug 28 16:02:28 2011 +0200
+++ b/runtime/indent/html.vim Sun Aug 28 11:57:32 2011 -0400
@@ -76,7 +76,6 @@
call <SID>HtmlIndentPush('object')
call <SID>HtmlIndentPush('ol')
call <SID>HtmlIndentPush('optgroup')
-" call <SID>HtmlIndentPush('pre')
call <SID>HtmlIndentPush('q')
call <SID>HtmlIndentPush('s')
call <SID>HtmlIndentPush('samp')
@@ -96,6 +95,35 @@
call <SID>HtmlIndentPush('ul')
call <SID>HtmlIndentPush('var')
+" html 5.0 tags
+call <SID>HtmlIndentPush('article')
+call <SID>HtmlIndentPush('aside')
+call <SID>HtmlIndentPush('audio')
+call <SID>HtmlIndentPush('canvas')
+call <SID>HtmlIndentPush('command')
+call <SID>HtmlIndentPush('datalist')
+call <SID>HtmlIndentPush('details')
+call <SID>HtmlIndentPush('embed')
+call <SID>HtmlIndentPush('figcaption')
+call <SID>HtmlIndentPush('figure')
+call <SID>HtmlIndentPush('footer')
+call <SID>HtmlIndentPush('header')
+call <SID>HtmlIndentPush('hgroup')
+call <SID>HtmlIndentPush('keygen')
+call <SID>HtmlIndentPush('mark')
+call <SID>HtmlIndentPush('meter')
+call <SID>HtmlIndentPush('nav')
+call <SID>HtmlIndentPush('output')
+call <SID>HtmlIndentPush('progress')
+call <SID>HtmlIndentPush('rp')
+call <SID>HtmlIndentPush('rt')
+call <SID>HtmlIndentPush('ruby')
+call <SID>HtmlIndentPush('section')
+call <SID>HtmlIndentPush('source')
+call <SID>HtmlIndentPush('summary')
+call <SID>HtmlIndentPush('time')
+call <SID>HtmlIndentPush('video')
+call <SID>HtmlIndentPush('wbr')
" [-- <ELEMENT ? O O ...> --]
if !exists('g:html_indent_strict')
diff -r ba9f075a347d runtime/syntax/html.vim
--- a/runtime/syntax/html.vim Sun Aug 28 16:02:28 2011 +0200
+++ b/runtime/syntax/html.vim Sun Aug 28 11:57:32 2011 -0400
@@ -54,11 +54,18 @@
syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
-" new html 4.0 tags
+" html 4.0 tags
syn keyword htmlTagName contained abbr acronym bdo button col label
syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
+" html 5.0 tags
+syn keyword htmlTagName contained article aside audio canvas command datalist
+syn keyword htmlTagName contained details embed figcaption figure footer header
+syn keyword htmlTagName contained hgroup keygen mark meter nav output progress
+syn keyword htmlTagName contained rp rt ruby section source summary time
+syn keyword htmlTagName contained video wbr
+
" legal arg names
syn keyword htmlArg contained action
syn keyword htmlArg contained align alink alt archive background bgcolor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment