-
-
Save rcmachado/256840 to your computer and use it in GitHub Desktop.
" Vim syntax file | |
" Language: HTML (version 5) | |
" Maintainer: Rodrigo Machado <[email protected]> | |
" URL: http://gist.github.com/256840 | |
" Last Change: 2010 Aug 26 | |
" License: Public domain | |
" (but let me know if you liked it :) ) | |
" | |
" Note: This file just adds the new tags from HTML 5 | |
" and don't replace default html.vim syntax file | |
" HTML 5 tags | |
syn keyword htmlTagName contained article aside audio bb canvas command datagrid | |
syn keyword htmlTagName contained datalist details dialog embed figure footer | |
syn keyword htmlTagName contained header hgroup keygen mark meter nav output | |
syn keyword htmlTagName contained progress time ruby rt rp section time video | |
syn keyword htmlTagName contained source figcaption | |
" HTML 5 arguments | |
syn keyword htmlArg contained autofocus autocomplete placeholder min max step | |
syn keyword htmlArg contained contenteditable contextmenu draggable hidden item | |
syn keyword htmlArg contained itemprop list sandbox subject spellcheck | |
syn keyword htmlArg contained novalidate seamless pattern formtarget manifest | |
syn keyword htmlArg contained formaction formenctype formmethod formnovalidate | |
syn keyword htmlArg contained sizes scoped async reversed sandbox srcdoc | |
syn keyword htmlArg contained hidden role | |
syn match htmlArg "\<\(aria-[\-a-zA-Z0-9_]\+\)=" contained | |
syn match htmlArg contained "\s*data-[-a-zA-Z0-9_]\+" |
Came looking for html5 tags added to GVim html syntax coloring. hokapoka's idea for css is the frosting-on-the-cake. More importantly, I think I've been inspired to make a new syntax list for Maptool, a java program that has it's own macro system built-in.
tyvm!
I like it !! thx :)
Works like a charm! Hokapoka too! Thanks!
I love it. This is what I want.
Hey folks, I think that @othree has made a better work here:
https://github.com/othree/html5.vim
Thanks!
good job
great work and thanks for the link of html5.vim
So, sometime, especially if I'm working with D3, my HTML5 documents have CSS, JavaScript, and SVG all embedded in the HTML code. Is there a simple way for syntax highlight all of this?
You can switch the filetype while you're in the CSS portion or whatever -- :set filetype=css
or set filetype=javascript
etc. I set up a mapping to make it easier, e.g. nnoremap <leader>ftc :set filetype=css<cr>
.
@andrewle I had the same problem, until I noticed that the indentation file I'd copied had the following at line 19:
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
Since I was putting my indent file in an /after directory, it of course was ditching out immediately. Deleting these lines fixed it.