From e2bbed8acc1f1cf498a0085cf771cf9bf40fb709 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 24 Sep 2020 10:50:19 +0200 Subject: Fix django highlighting, fixes #553 --- README.md | 10 +-- after/syntax/ruby.vim | 13 ++-- autoload/polyglot.vim | 2 +- autoload/sleuth.vim | 9 ++- ftdetect/polyglot.vim | 35 +++++---- ftplugin/aspvbs.vim | 64 ++++++++++++++++ ftplugin/handlebars.vim | 127 ++++++++++++++++++++++++++++++ ftplugin/htmldjango.vim | 17 +++++ ftplugin/mustache.vim | 124 +----------------------------- heuristics.yaml | 2 +- indent/handlebars.vim | 129 +++++++++++++++++++++++++++++++ indent/htmldjango.vim | 16 ++++ indent/jinja.vim | 84 -------------------- indent/mustache.vim | 126 +----------------------------- packages.yaml | 46 ++++++----- scripts/build | 14 ++-- syntax/aspperl.vim | 29 +++++++ syntax/aspvbs.vim | 186 ++++++++++++++++++++++++++++++++++++++++++++ syntax/django.vim | 87 +++++++++++++++++++++ syntax/handlebars.vim | 110 ++++++++++++++++++++++++++ syntax/html-1.vim | 196 ----------------------------------------------- syntax/html-2.vim | 94 ----------------------- syntax/html.vim | 199 +++++++++++++++++++++++++++++++++++++++++++++++- syntax/htmldjango.vim | 30 ++++++++ syntax/jinja.vim | 90 ---------------------- syntax/mustache.vim | 107 +------------------------- tests/extensions.vim | 15 +++- tests/filetypes.vim | 5 +- 28 files changed, 1080 insertions(+), 886 deletions(-) create mode 100644 ftplugin/aspvbs.vim create mode 100644 ftplugin/handlebars.vim create mode 100644 ftplugin/htmldjango.vim create mode 100644 indent/handlebars.vim create mode 100644 indent/htmldjango.vim delete mode 100644 indent/jinja.vim create mode 100644 syntax/aspperl.vim create mode 100644 syntax/aspvbs.vim create mode 100644 syntax/django.vim create mode 100644 syntax/handlebars.vim delete mode 100644 syntax/html-1.vim delete mode 100644 syntax/html-2.vim create mode 100644 syntax/htmldjango.vim delete mode 100644 syntax/jinja.vim diff --git a/README.md b/README.md index 6691627f..1cf07bec 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ If you need full functionality of any plugin, please use it directly with your p - [ansible](https://github.com/pearofducks/ansible-vim) - [ant](https://github.com/vim/vim/tree/master/runtime) - [apache](https://github.com/vim/vim/tree/master/runtime) -- [apiblueprint](https://github.com/sheerun/apiblueprint.vim) +- [apiblueprint](https://github.com/kylef/apiblueprint.vim) - [applescript](https://github.com/mityu/vim-applescript) - [aptconf](https://github.com/vim/vim/tree/master/runtime) - [arch](https://github.com/vim/vim/tree/master/runtime) @@ -123,8 +123,8 @@ If you need full functionality of any plugin, please use it directly with your p - [graphql](https://github.com/jparise/vim-graphql) - [groovy](https://github.com/vim/vim/tree/master/runtime) - [grub](https://github.com/vim/vim/tree/master/runtime) -- [haml](https://github.com/sheerun/vim-haml) -- [handlebars](https://github.com/sheerun/vim-mustache-handlebars) +- [haml](https://github.com/tpope/vim-haml) +- [handlebars](https://github.com/mustache/vim-mustache-handlebars) - [haproxy](https://github.com/CH-DanReif/haproxy.vim) - [haskell](https://github.com/neovimhaskell/haskell-vim) - [haxe](https://github.com/yaymukund/vim-haxe) @@ -133,6 +133,7 @@ If you need full functionality of any plugin, please use it directly with your p - [help](https://github.com/neovim/neovim/tree/master/runtime) - [hive](https://github.com/zebradil/hive.vim) - [html5](https://github.com/othree/html5.vim) +- [htmldjango](https://github.com/vim/vim/tree/master/runtime) - [i3](https://github.com/mboughaba/i3config.vim) - [icalendar](https://github.com/chutzpah/icalendar.vim) - [idris2](https://github.com/edwinb/idris2-vim) @@ -141,7 +142,6 @@ If you need full functionality of any plugin, please use it directly with your p - [javascript-sql](https://github.com/statico/vim-javascript-sql) - [javascript](https://github.com/pangloss/vim-javascript) - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) -- [jinja](https://github.com/lepture/vim-jinja) - [jq](https://github.com/vito-c/jq.vim) - [json5](https://github.com/GutenYe/json5.vim) - [json](https://github.com/elzr/vim-json) @@ -239,7 +239,7 @@ If you need full functionality of any plugin, please use it directly with your p - [xml](https://github.com/amadeus/vim-xml) - [xsl](https://github.com/vim-scripts/XSLT-syntax) - [yaml](https://github.com/vim/vim/tree/df44a27b53586fccfc6a3aedc89061fdd9a515ff/runtime) -- [yard](https://github.com/sheerun/vim-yardoc) +- [yard](https://github.com/noprompt/vim-yardoc) - [zephir](https://github.com/xwsoul/vim-zephir) - [zig](https://github.com/ziglang/zig.vim) - [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax) diff --git a/after/syntax/ruby.vim b/after/syntax/ruby.vim index 00cd07d9..a135b6a8 100644 --- a/after/syntax/ruby.vim +++ b/after/syntax/ruby.vim @@ -22,6 +22,7 @@ syn match yardNote "@note" contained syn match yardOption "@option" contained syn match yardOverload "@overload" contained syn match yardParam "@param" contained +syn match yardParamName /@param \h\+/hs=s+7 contained contains=yardParam syn match yardPrivate "@private" contained syn match yardRaise "@raise" contained syn match yardReturn "@return" contained @@ -32,7 +33,7 @@ syn match yardVersion "@version" contained syn match yardYield "@yield" contained syn match yardYieldParam "@yieldparam" contained syn match yardYieldReturn "@yieldreturn" contained -syn cluster yardTags contains=yardGenericTag,yardAbstract,yardApi,yardAttr,yardAttrReader,yardAttrWriter,yardAuthor,yardDeprecated,yardExample,yardNote,yardOption,yardOverload,yardParam,yardPrivate,yardRaise,yardReturn,yardSee,yardSince,yardTodo,yardVersion,yardYield,yardYieldParam,yardYieldReturn +syn cluster yardTags contains=yardGenericTag,yardAbstract,yardApi,yardAttr,yardAttrReader,yardAttrWriter,yardAuthor,yardDeprecated,yardExample,yardNote,yardOption,yardOverload,yardParam,yardParamName,yardPrivate,yardRaise,yardReturn,yardSee,yardSince,yardTodo,yardVersion,yardYield,yardYieldParam,yardYieldReturn """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Directives @@ -81,7 +82,7 @@ syn cluster rubyNotTop add=@yardTags,@yardDirectives,@yardTypes,@yardLists,@yard """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" hi def link yardComment rubyComment " Tags -hi def link yardGenericTag rubyKeyword +hi def link yardGenericTag rubyTodo hi def link yardAbstract yardGenericTag hi def link yardApi yardGenericTag hi def link yardAttr yardGenericTag @@ -101,11 +102,11 @@ hi def link yardSee yardGenericTag hi def link yardSince yardGenericTag hi def link yardTodo yardGenericTag hi def link yardVersion yardGenericTag -hi def link yield yardGenericTag -hi def link yieldparam yardGenericTag -hi def link yieldreturn yardGenericTag +hi def link yardYield yardGenericTag +hi def link yardYieldParam yardGenericTag +hi def link yardYieldReturn yardGenericTag " Directives -hi def link yardGenericDirective rubyKeyword +hi def link yardGenericDirective rubyTodo hi def link yardAttribute yardGenericDirective hi def link yardEndGroup yardGenericDirective hi def link yardGroup yardGenericDirective diff --git a/autoload/polyglot.vim b/autoload/polyglot.vim index d8ee601f..97a83752 100644 --- a/autoload/polyglot.vim +++ b/autoload/polyglot.vim @@ -373,7 +373,7 @@ func! polyglot#DetectHtmlFiletype() for lnum in range(1, min([line("$"), 50])) let line = getline(lnum) if line =~# '{{.*}}\|{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)\|{#\s\+' - set ft=jinja.html | return + set ft=htmldjango | return endif if line =~# '\(\<\|\>\)DTD\s\+XHTML\s' set ft=xhtml | return diff --git a/autoload/sleuth.vim b/autoload/sleuth.vim index ae101289..0bb73fd8 100644 --- a/autoload/sleuth.vim +++ b/autoload/sleuth.vim @@ -38,7 +38,7 @@ let s:globs = { \ 'basic': '*.basic', \ 'blade': '*.blade,*.blade.php', \ 'brewfile': 'Brewfile', - \ 'bzl': '*.bzl,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', + \ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', \ 'c': '*.c,*.cats,*.h,*.idc,*.qc', \ 'caddyfile': 'Caddyfile', \ 'carp': '*.carp', @@ -101,7 +101,10 @@ let s:globs = { \ 'help': '', \ 'hive': '*.q,*.hql,*.ql', \ 'html': '*.html,*.htm,*.html.hl,*.inc,*.st,*.xht,*.xhtml', + \ 'html.handlebars': '*.handlebars,*.hbs,*.hdbs,*.hb', + \ 'html.mustache': '*.mustache,*.hogan,*.hulk,*.hjs', \ 'html.twig': '*.twig', + \ 'htmldjango': '*.jinja,*.j2,*.jinja2,*.njk', \ 'i3config': '*.i3.config,*.i3config,i3.config,i3config', \ 'icalendar': '*.ics', \ 'idris': '*.idr,*.lidr,idris-response', @@ -109,7 +112,6 @@ let s:globs = { \ 'ion': '*.ion', \ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile', \ 'javascriptreact': '*.jsx', - \ 'jinja.html': '*.jinja,*.j2,*.jinja2', \ 'jq': '*.jq', \ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,composer.lock,mcmod.info,Pipfile.lock', \ 'json5': '*.json5', @@ -135,7 +137,6 @@ let s:globs = { \ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma', \ 'moon': '*.moon', \ 'murphi': '*.m', - \ 'mustache': '*.handlebars,*.hbs,*.hulk,*.hjs,*.mustache,*.njk,*.hogan,*.hdbs,*.hb', \ 'nginx': '*.nginx,*.nginxconf,*.vhost,nginx.conf,nginx*.conf,*nginx.conf', \ 'nim': '*.nim,*.nim.cfg,*.nimble,*.nimrod,*.nims,nim.cfg', \ 'nix': '*.nix', @@ -216,7 +217,7 @@ let s:globs = { \ 'vmasm': '*.mar', \ 'vue': '*.vue,*.wpy', \ 'xdc': '*.xdc', - \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.ps1xml,*.psc1,*.pt,*.rdf,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config', + \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.ps1xml,*.psc1,*.pt,*.rdf,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config', \ 'xml.twig': '*.xml.twig', \ 'xs': '*.xs', \ 'xsl': '*.xslt,*.xsl', diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index f9b6a670..d6379ae2 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -156,7 +156,7 @@ if !has_key(s:disabled_packages, 'ampl') endif if !has_key(s:disabled_packages, 'xml') - au! BufRead,BufNewFile *.csproj,*.ui,*.wsdl,*.wsf,*.xlf,*.xliff,*.xmi,*.xsd,*.xul + au! BufRead,BufNewFile *.csproj,*.ui,*.wsdl,*.wsf,*.xlf,*.xliff,*.xmi,*.xsd,*.xul,*.tpm,*.csproj.user,*.wpl endif if !has_key(s:disabled_packages, 'ant') @@ -488,7 +488,7 @@ if !has_key(s:disabled_packages, 'dosini') endif if !has_key(s:disabled_packages, 'bzl') - au! BufRead,BufNewFile *.bzl,BUILD,WORKSPACE + au! BufRead,BufNewFile *.bzl,*.bazel,*.BUILD,BUILD,WORKSPACE endif if !has_key(s:disabled_packages, 'tads') @@ -591,6 +591,7 @@ if !has_key(s:disabled_packages, 'xml') au BufNewFile,BufRead *.csdef set ft=xml au BufNewFile,BufRead *.csl set ft=xml au BufNewFile,BufRead *.csproj set ft=xml + au BufNewFile,BufRead *.csproj.user set ft=xml au BufNewFile,BufRead *.ct set ft=xml au BufNewFile,BufRead *.depproj set ft=xml au BufNewFile,BufRead *.dita set ft=xml @@ -643,6 +644,7 @@ if !has_key(s:disabled_packages, 'xml') au BufNewFile,BufRead *.sublime-snippet set ft=xml au BufNewFile,BufRead *.targets set ft=xml au BufNewFile,BufRead *.tml set ft=xml + au BufNewFile,BufRead *.tpm set ft=xml au BufNewFile,BufRead *.ui set ft=xml au BufNewFile,BufRead *.urdf set ft=xml au BufNewFile,BufRead *.ux set ft=xml @@ -654,6 +656,7 @@ if !has_key(s:disabled_packages, 'xml') au BufNewFile,BufRead *.vxml set ft=xml au BufNewFile,BufRead *.wixproj set ft=xml au BufNewFile,BufRead *.workflow set ft=xml + au BufNewFile,BufRead *.wpl set ft=xml au BufNewFile,BufRead *.wsdl set ft=xml au BufNewFile,BufRead *.wsf set ft=xml au BufNewFile,BufRead *.wxi set ft=xml @@ -1099,15 +1102,14 @@ if !has_key(s:disabled_packages, 'haml') endif if !has_key(s:disabled_packages, 'handlebars') - au BufNewFile,BufRead *.handlebars set ft=mustache - au BufNewFile,BufRead *.hb set ft=mustache - au BufNewFile,BufRead *.hbs set ft=mustache - au BufNewFile,BufRead *.hdbs set ft=mustache - au BufNewFile,BufRead *.hjs set ft=mustache - au BufNewFile,BufRead *.hogan set ft=mustache - au BufNewFile,BufRead *.hulk set ft=mustache - au BufNewFile,BufRead *.mustache set ft=mustache - au BufNewFile,BufRead *.njk set ft=mustache + au BufNewFile,BufRead *.hjs set ft=html.mustache + au BufNewFile,BufRead *.hogan set ft=html.mustache + au BufNewFile,BufRead *.hulk set ft=html.mustache + au BufNewFile,BufRead *.mustache set ft=html.mustache + au BufNewFile,BufRead *.handlebars set ft=html.handlebars + au BufNewFile,BufRead *.hb set ft=html.handlebars + au BufNewFile,BufRead *.hbs set ft=html.handlebars + au BufNewFile,BufRead *.hdbs set ft=html.handlebars endif if !has_key(s:disabled_packages, 'haskell') @@ -1184,10 +1186,11 @@ if !has_key(s:disabled_packages, 'jenkins') au BufNewFile,BufRead Jenkinsfile* call s:StarSetf('Jenkinsfile') endif -if !has_key(s:disabled_packages, 'jinja') - au BufNewFile,BufRead *.j2 set ft=jinja.html - au BufNewFile,BufRead *.jinja set ft=jinja.html - au BufNewFile,BufRead *.jinja2 set ft=jinja.html +if !has_key(s:disabled_packages, 'htmldjango') + au BufNewFile,BufRead *.j2 set ft=htmldjango + au BufNewFile,BufRead *.jinja set ft=htmldjango + au BufNewFile,BufRead *.jinja2 set ft=htmldjango + au BufNewFile,BufRead *.njk set ft=htmldjango endif if !has_key(s:disabled_packages, 'jq') @@ -1992,6 +1995,8 @@ if !has_key(s:disabled_packages, 'odin') endif if !has_key(s:disabled_packages, 'bzl') + au BufNewFile,BufRead *.BUILD set ft=bzl + au BufNewFile,BufRead *.bazel set ft=bzl au BufNewFile,BufRead *.bzl set ft=bzl au BufNewFile,BufRead BUCK set ft=bzl au BufNewFile,BufRead BUILD set ft=bzl diff --git a/ftplugin/aspvbs.vim b/ftplugin/aspvbs.vim new file mode 100644 index 00000000..c2afec5a --- /dev/null +++ b/ftplugin/aspvbs.vim @@ -0,0 +1,64 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aspvbs') == -1 + +" Vim filetype plugin file +" Language: aspvbs +" Maintainer: Dan Sharp +" Last Changed: 20 Jan 2009 +" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin + +if exists("b:did_ftplugin") | finish | endif + +" Make sure the continuation lines below do not cause problems in +" compatibility mode. +let s:save_cpo = &cpo +set cpo-=C + +" Define some defaults in case the included ftplugins don't set them. +let s:undo_ftplugin = "" +let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" . + \ "All Files (*.*)\t*.*\n" +let s:match_words = "" + +runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +let b:did_ftplugin = 1 + +" Override our defaults if these were set by an included ftplugin. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin +endif +if exists("b:browsefilter") + let s:browsefilter = b:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words +endif + +" ASP: Active Server Pages (with Visual Basic Script) +" thanks to Gontran BAERTS +if exists("loaded_matchit") + let s:notend = '\%(\\%(.\{-}then\s\+\w\)\@!:\:^\s*\:\,' . + \ s:notend . '\:\:\:\,' . + \ '^\s*\:\,' . + \ '^\s*\:\,' . + \ '\:\,' . + \ '^\s*\:\,' . + \ '^\s*\:\,' . + \ '\:\,' . + \ s:match_words +endif + +" Change the :browse e filter to primarily show ASP-related files. +if has("gui_win32") + let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter +endif + +let b:undo_ftplugin = "unlet! b:match_words b:match_ignorecase b:browsefilter | " . s:undo_ftplugin + +" Restore the saved compatibility options. +let &cpo = s:save_cpo +unlet s:save_cpo + +endif diff --git a/ftplugin/handlebars.vim b/ftplugin/handlebars.vim new file mode 100644 index 00000000..649984aa --- /dev/null +++ b/ftplugin/handlebars.vim @@ -0,0 +1,127 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 + +if exists('b:loaded_mustache_handlebars') + finish +endif +let b:loaded_mustache_handlebars = 1 + +let s:cpo_save = &cpo +set cpo&vim + +" Matchit support for Mustache & Handlebars +" extending HTML matchit groups +if exists("loaded_matchit") && exists("b:match_words") + let b:match_words = b:match_words + \ . ',{:},[:],(:),' + \ . '\%({{\)\@<=#\s*\%(if\|unless\)\s*.\{-}}}' + \ . ':' + \ . '\%({{\)\@<=\s*else\s*}}' + \ . ':' + \ . '\%({{\)\@<=/\s*\%(if\|unless\)\s*}},' + \ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\).\{-}}}' + \ . ':' + \ . '\%({{\)\@<=/\s*\1\s*}}' +endif + +" Set template for comment +setlocal commentstring={{!--\ %s\ --}} + +if exists("g:mustache_abbreviations") + inoremap {{{ {{{}}} + inoremap {{ {{}} + inoremap {{! {{!}} + inoremap {{< {{<}} + inoremap {{> {{>}} + inoremap {{# {{#}}{{/}} + inoremap {{if {{#if }}{{/if}} + inoremap {{ife {{#if }}{{else}}{{/if}} +endif + + +" Section movement +" Adapted from vim-ruby - many thanks to the maintainers of that plugin + +function! s:sectionmovement(pattern,flags,mode,count) + norm! m' + if a:mode ==# 'v' + norm! gv + endif + let i = 0 + while i < a:count + let i = i + 1 + " saving current position + let line = line('.') + let col = col('.') + let pos = search(a:pattern,'W'.a:flags) + " if there's no more matches, return to last position + if pos == 0 + call cursor(line,col) + return + endif + endwhile +endfunction + +nnoremap [[ :call sectionmovement('{{','b','n',v:count1) +nnoremap ]] :call sectionmovement('{{','' ,'n',v:count1) +xnoremap [[ :call sectionmovement('{{','b','v',v:count1) +xnoremap ]] :call sectionmovement('{{','' ,'v',v:count1) + + +" Operator pending mappings + +" Operators are available by default. Set `let g:mustache_operators = 0` in +" your .vimrc to disable them. +if ! exists("g:mustache_operators") + let g:mustache_operators = 1 +endif + +if exists("g:mustache_operators") && g:mustache_operators + onoremap ie :call wrap_inside() + onoremap ae :call wrap_around() + xnoremap ie :call wrap_inside() + xnoremap ae :call wrap_around() +endif + +function! s:wrap_around() + " If the cursor is at the end of the tag element, move back + " so that the end tag can be detected. + while getline('.')[col('.')-1] ==# '}' + execute 'norm h' + endwhile + + " Moves to the end of the closing tag + let pos = search('}}','We') + if pos != 0 + if getline('.')[col('.')] ==# '}' + " Ending tag contains 3 closing brackets '}}}', + " move to the last bracket. + execute 'norm l' + endif + + " select the whole tag + execute 'norm v%' + endif +endfunction + +function! s:wrap_inside() + " If the cursor is at the end of the tag element, move back + " so that the end tag can be detected. + while getline('.')[col('.')-1] ==# '}' + execute 'norm h' + endwhile + + " Moves to the end of the closing tag + let pos = search('}}','W') + if pos != 0 + " select only inside the tag + execute 'norm v%loho' + endif +endfunction + + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nofoldenable + +endif diff --git a/ftplugin/htmldjango.vim b/ftplugin/htmldjango.vim new file mode 100644 index 00000000..55489c0f --- /dev/null +++ b/ftplugin/htmldjango.vim @@ -0,0 +1,17 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'htmldjango') == -1 + +" Vim filetype plugin file +" Language: Django HTML template +" Maintainer: Dave Hodder +" Last Change: 2007 Jan 25 + +" Only use this filetype plugin when no other was loaded. +if exists("b:did_ftplugin") + finish +endif + +" Use HTML and Django template ftplugins. +runtime! ftplugin/html.vim +runtime! ftplugin/django.vim + +endif diff --git a/ftplugin/mustache.vim b/ftplugin/mustache.vim index 649984aa..7ca19b76 100644 --- a/ftplugin/mustache.vim +++ b/ftplugin/mustache.vim @@ -1,127 +1,5 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 -if exists('b:loaded_mustache_handlebars') - finish -endif -let b:loaded_mustache_handlebars = 1 - -let s:cpo_save = &cpo -set cpo&vim - -" Matchit support for Mustache & Handlebars -" extending HTML matchit groups -if exists("loaded_matchit") && exists("b:match_words") - let b:match_words = b:match_words - \ . ',{:},[:],(:),' - \ . '\%({{\)\@<=#\s*\%(if\|unless\)\s*.\{-}}}' - \ . ':' - \ . '\%({{\)\@<=\s*else\s*}}' - \ . ':' - \ . '\%({{\)\@<=/\s*\%(if\|unless\)\s*}},' - \ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\).\{-}}}' - \ . ':' - \ . '\%({{\)\@<=/\s*\1\s*}}' -endif - -" Set template for comment -setlocal commentstring={{!--\ %s\ --}} - -if exists("g:mustache_abbreviations") - inoremap {{{ {{{}}} - inoremap {{ {{}} - inoremap {{! {{!}} - inoremap {{< {{<}} - inoremap {{> {{>}} - inoremap {{# {{#}}{{/}} - inoremap {{if {{#if }}{{/if}} - inoremap {{ife {{#if }}{{else}}{{/if}} -endif - - -" Section movement -" Adapted from vim-ruby - many thanks to the maintainers of that plugin - -function! s:sectionmovement(pattern,flags,mode,count) - norm! m' - if a:mode ==# 'v' - norm! gv - endif - let i = 0 - while i < a:count - let i = i + 1 - " saving current position - let line = line('.') - let col = col('.') - let pos = search(a:pattern,'W'.a:flags) - " if there's no more matches, return to last position - if pos == 0 - call cursor(line,col) - return - endif - endwhile -endfunction - -nnoremap [[ :call sectionmovement('{{','b','n',v:count1) -nnoremap ]] :call sectionmovement('{{','' ,'n',v:count1) -xnoremap [[ :call sectionmovement('{{','b','v',v:count1) -xnoremap ]] :call sectionmovement('{{','' ,'v',v:count1) - - -" Operator pending mappings - -" Operators are available by default. Set `let g:mustache_operators = 0` in -" your .vimrc to disable them. -if ! exists("g:mustache_operators") - let g:mustache_operators = 1 -endif - -if exists("g:mustache_operators") && g:mustache_operators - onoremap ie :call wrap_inside() - onoremap ae :call wrap_around() - xnoremap ie :call wrap_inside() - xnoremap ae :call wrap_around() -endif - -function! s:wrap_around() - " If the cursor is at the end of the tag element, move back - " so that the end tag can be detected. - while getline('.')[col('.')-1] ==# '}' - execute 'norm h' - endwhile - - " Moves to the end of the closing tag - let pos = search('}}','We') - if pos != 0 - if getline('.')[col('.')] ==# '}' - " Ending tag contains 3 closing brackets '}}}', - " move to the last bracket. - execute 'norm l' - endif - - " select the whole tag - execute 'norm v%' - endif -endfunction - -function! s:wrap_inside() - " If the cursor is at the end of the tag element, move back - " so that the end tag can be detected. - while getline('.')[col('.')-1] ==# '}' - execute 'norm h' - endwhile - - " Moves to the end of the closing tag - let pos = search('}}','W') - if pos != 0 - " select only inside the tag - execute 'norm v%loho' - endif -endfunction - - -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: nofoldenable +runtime! ftplugin/handlebars*.vim ftplugin/handlebars/*.vim endif diff --git a/heuristics.yaml b/heuristics.yaml index 60df69b5..c53a704c 100644 --- a/heuristics.yaml +++ b/heuristics.yaml @@ -183,7 +183,7 @@ rules: - lines: 50 rules: - pattern: '{{.*}}|{%-?\s*(end.*|extends|block|macro|set|if|for|include|trans)\b|{#\s+' - filetype: jinja.html + filetype: htmldjango - pattern: '\bDTD\s+XHTML\s' filetype: xhtml - filetype: html diff --git a/indent/handlebars.vim b/indent/handlebars.vim new file mode 100644 index 00000000..fbff2fa0 --- /dev/null +++ b/indent/handlebars.vim @@ -0,0 +1,129 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 + +" Mustache & Handlebars syntax +" Language: Mustache, Handlebars +" Maintainer: Juvenn Woo +" Screenshot: http://imgur.com/6F408 +" Version: 3 +" Last Change: 26 Nov 2018 +" Remarks: based on eruby indent plugin by tpope +" References: +" [Mustache](http://github.com/defunkt/mustache) +" [Handlebars](https://github.com/wycats/handlebars.js) +" [ctemplate](http://code.google.com/p/google-ctemplate/) +" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html) +" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html) + +if exists("b:did_indent_hbs") + finish +endif + +unlet! b:did_indent +setlocal indentexpr= + +runtime! indent/html.vim +unlet! b:did_indent + +" Force HTML indent to not keep state. +let b:html_indent_usestate = 0 + +if &l:indentexpr == '' + if &l:cindent + let &l:indentexpr = 'cindent(v:lnum)' + else + let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))' + endif +endif +let b:handlebars_subtype_indentexpr = &l:indentexpr + +let b:did_indent = 1 +let b:did_indent_hbs = 1 + +setlocal indentexpr=GetHandlebarsIndent() +setlocal indentkeys=o,O,*,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when + +" Only define the function once. +if exists("*GetHandlebarsIndent") + finish +endif + +function! GetHandlebarsIndent(...) + " The value of a single shift-width + if exists('*shiftwidth') + let sw = shiftwidth() + else + let sw = &sw + endif + + if a:0 && a:1 == '.' + let v:lnum = line('.') + elseif a:0 && a:1 =~ '^\d' + let v:lnum = a:1 + endif + let vcol = col('.') + call cursor(v:lnum,1) + call cursor(v:lnum,vcol) + exe "let ind = ".b:handlebars_subtype_indentexpr + + " Workaround for Andy Wokula's HTML indent. This should be removed after + " some time, since the newest version is fixed in a different way. + if b:handlebars_subtype_indentexpr =~# '^HtmlIndent(' + \ && exists('b:indent') + \ && type(b:indent) == type({}) + \ && has_key(b:indent, 'lnum') + " Force HTML indent to not keep state + let b:indent.lnum = -1 + endif + let lnum = prevnonblank(v:lnum-1) + let prevLine = getline(lnum) + let currentLine = getline(v:lnum) + + " all indent rules only apply if the block opening/closing + " tag is on a separate line + + " indent after block {{#block + if prevLine =~# '\v\s*\{\{[#^].*\s*' + let ind = ind + sw + endif + " but not if the block ends on the same line + if prevLine =~# '\v\s*\{\{\#(.+)(\s+|\}\}).*\{\{\/\1' + let ind = ind - sw + endif + " unindent after block close {{/block}} + if currentLine =~# '\v^\s*\{\{\/\S*\}\}\s*' + let ind = ind - sw + endif + " indent after component block {{a-component + if prevLine =~# '\v\s*\{\{\w' + let ind = ind + sw + endif + " but not if the component block ends on the same line + if prevLine =~# '\v\s*\{\{\w(.+)\}\}' + let ind = ind - sw + endif + " unindent }} lines, and following lines if not inside a block expression + let savedPos = getpos('.') + if currentLine =~# '\v^\s*\}\}\s*$' || (currentLine !~# '\v^\s*\{\{\/' && prevLine =~# '\v^\s*[^\{\} \t]+\}\}\s*$') + let closingLnum = search('}}\s*$', 'Wbc', lnum) + let [openingLnum, col] = searchpairpos('{{', '', '}}', 'Wb') + if openingLnum > 0 && closingLnum > 0 + if strpart(getline(openingLnum), col - 1, 3) !~ '{{[#^]' + let ind = ind - sw + endif + else + call setpos('.', savedPos) + endif + endif + " unindent {{else}} + if currentLine =~# '\v^\s*\{\{else.*\}\}\s*$' + let ind = ind - sw + endif + " indent again after {{else}} + if prevLine =~# '\v^\s*\{\{else.*\}\}\s*$' + let ind = ind + sw + endif + + return ind +endfunction + +endif diff --git a/indent/htmldjango.vim b/indent/htmldjango.vim new file mode 100644 index 00000000..493ced54 --- /dev/null +++ b/indent/htmldjango.vim @@ -0,0 +1,16 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'htmldjango') == -1 + +" Vim indent file +" Language: Django HTML template +" Maintainer: Dave Hodder +" Last Change: 2007 Jan 25 + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif + +" Use HTML formatting rules. +runtime! indent/html.vim + +endif diff --git a/indent/jinja.vim b/indent/jinja.vim deleted file mode 100644 index da7d676f..00000000 --- a/indent/jinja.vim +++ /dev/null @@ -1,84 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1 - -" Vim indent file -" Language: Jinja HTML template -" Maintainer: Evan Hammer -" Last Change: 2013 Jan 26 - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif - -" Use HTML formatting rules. -setl indentkeys=o,O,,<>>,!^F -runtime! indent/html.vim +setl nosmartindent -let b:did_indent = 1 - -" Indent within the jinja tags -" Made by Steve Losh -if &l:indentexpr == '' - if &l:cindent - let &l:indentexpr = 'cindent(v:lnum)' - else - let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))' - endif -endif -let b:html_indentexpr = &l:indentexpr - -let b:did_indent = 1 - -setlocal indentexpr=GetDjangoIndent() -setlocal indentkeys=o,O,*,{,},o,O,!^F,<>> - -" Only define the function once. -if exists("*GetDjangoIndent") - finish -endif - -function! GetDjangoIndent(...) - if a:0 && a:1 == '.' - let v:lnum = line('.') - elseif a:0 && a:1 =~ '^\d' - let v:lnum = a:1 - endif - let vcol = col('.') - - call cursor(v:lnum,vcol) - - exe "let ind = ".b:html_indentexpr - - let lnum = prevnonblank(v:lnum-1) - let pnb = getline(lnum) - let cur = getline(v:lnum) - - let tagstart = '.*' . '{%\s*' - let tagend = '.*%}' . '.*' - - let blocktags = '\(block\|for\|if\|with\|autoescape\|comment\|filter\|spaceless\)' - let midtags = '\(empty\|else\|elif\)' - - let pnb_blockstart = pnb =~# tagstart . blocktags . tagend - let pnb_blockend = pnb =~# tagstart . 'end' . blocktags . tagend - let pnb_blockmid = pnb =~# tagstart . midtags . tagend - - let cur_blockstart = cur =~# tagstart . blocktags . tagend - let cur_blockend = cur =~# tagstart . 'end' . blocktags . tagend - let cur_blockmid = cur =~# tagstart . midtags . tagend - - if pnb_blockstart && !pnb_blockend - let ind = ind + &sw - elseif pnb_blockmid && !pnb_blockend - let ind = ind + &sw - endif - - if cur_blockend && !cur_blockstart - let ind = ind - &sw - elseif cur_blockmid - let ind = ind - &sw - endif - - return ind -endfunction - -endif diff --git a/indent/mustache.vim b/indent/mustache.vim index fbff2fa0..3387485e 100644 --- a/indent/mustache.vim +++ b/indent/mustache.vim @@ -1,129 +1,5 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 -" Mustache & Handlebars syntax -" Language: Mustache, Handlebars -" Maintainer: Juvenn Woo -" Screenshot: http://imgur.com/6F408 -" Version: 3 -" Last Change: 26 Nov 2018 -" Remarks: based on eruby indent plugin by tpope -" References: -" [Mustache](http://github.com/defunkt/mustache) -" [Handlebars](https://github.com/wycats/handlebars.js) -" [ctemplate](http://code.google.com/p/google-ctemplate/) -" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html) -" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html) - -if exists("b:did_indent_hbs") - finish -endif - -unlet! b:did_indent -setlocal indentexpr= - -runtime! indent/html.vim -unlet! b:did_indent - -" Force HTML indent to not keep state. -let b:html_indent_usestate = 0 - -if &l:indentexpr == '' - if &l:cindent - let &l:indentexpr = 'cindent(v:lnum)' - else - let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))' - endif -endif -let b:handlebars_subtype_indentexpr = &l:indentexpr - -let b:did_indent = 1 -let b:did_indent_hbs = 1 - -setlocal indentexpr=GetHandlebarsIndent() -setlocal indentkeys=o,O,*,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when - -" Only define the function once. -if exists("*GetHandlebarsIndent") - finish -endif - -function! GetHandlebarsIndent(...) - " The value of a single shift-width - if exists('*shiftwidth') - let sw = shiftwidth() - else - let sw = &sw - endif - - if a:0 && a:1 == '.' - let v:lnum = line('.') - elseif a:0 && a:1 =~ '^\d' - let v:lnum = a:1 - endif - let vcol = col('.') - call cursor(v:lnum,1) - call cursor(v:lnum,vcol) - exe "let ind = ".b:handlebars_subtype_indentexpr - - " Workaround for Andy Wokula's HTML indent. This should be removed after - " some time, since the newest version is fixed in a different way. - if b:handlebars_subtype_indentexpr =~# '^HtmlIndent(' - \ && exists('b:indent') - \ && type(b:indent) == type({}) - \ && has_key(b:indent, 'lnum') - " Force HTML indent to not keep state - let b:indent.lnum = -1 - endif - let lnum = prevnonblank(v:lnum-1) - let prevLine = getline(lnum) - let currentLine = getline(v:lnum) - - " all indent rules only apply if the block opening/closing - " tag is on a separate line - - " indent after block {{#block - if prevLine =~# '\v\s*\{\{[#^].*\s*' - let ind = ind + sw - endif - " but not if the block ends on the same line - if prevLine =~# '\v\s*\{\{\#(.+)(\s+|\}\}).*\{\{\/\1' - let ind = ind - sw - endif - " unindent after block close {{/block}} - if currentLine =~# '\v^\s*\{\{\/\S*\}\}\s*' - let ind = ind - sw - endif - " indent after component block {{a-component - if prevLine =~# '\v\s*\{\{\w' - let ind = ind + sw - endif - " but not if the component block ends on the same line - if prevLine =~# '\v\s*\{\{\w(.+)\}\}' - let ind = ind - sw - endif - " unindent }} lines, and following lines if not inside a block expression - let savedPos = getpos('.') - if currentLine =~# '\v^\s*\}\}\s*$' || (currentLine !~# '\v^\s*\{\{\/' && prevLine =~# '\v^\s*[^\{\} \t]+\}\}\s*$') - let closingLnum = search('}}\s*$', 'Wbc', lnum) - let [openingLnum, col] = searchpairpos('{{', '', '}}', 'Wb') - if openingLnum > 0 && closingLnum > 0 - if strpart(getline(openingLnum), col - 1, 3) !~ '{{[#^]' - let ind = ind - sw - endif - else - call setpos('.', savedPos) - endif - endif - " unindent {{else}} - if currentLine =~# '\v^\s*\{\{else.*\}\}\s*$' - let ind = ind - sw - endif - " indent again after {{else}} - if prevLine =~# '\v^\s*\{\{else.*\}\}\s*$' - let ind = ind + sw - endif - - return ind -endfunction +runtime! indent/handlebars.vim endif diff --git a/packages.yaml b/packages.yaml index 6cec2b08..29715093 100644 --- a/packages.yaml +++ b/packages.yaml @@ -169,7 +169,7 @@ filetypes: - '*/etc/httpd/conf.d/*.conf*' --- name: apiblueprint -remote: sheerun/apiblueprint.vim +remote: kylef/apiblueprint.vim filetypes: - name: apiblueprint linguist: API Blueprint @@ -440,9 +440,6 @@ remote: tpope/vim-cucumber filetypes: - name: cucumber linguist: Gherkin - extra_extensions: - # https://github.com/search?q=extension%3Astory+when&type=Code - - story --- name: cue remote: mgrabovsky/vim-cuesheet @@ -720,7 +717,8 @@ filetypes: - '*/etc/grub.conf' --- name: haml -remote: sheerun/vim-haml +remote: tpope/vim-haml +glob: '**/haml.vim' filetypes: - name: haml linguist: Haml @@ -729,16 +727,17 @@ filetypes: - hamlbars --- name: handlebars -remote: sheerun/vim-mustache-handlebars +remote: mustache/vim-mustache-handlebars filetypes: -- name: mustache - linguist: Handlebars +- name: html.mustache + linguist: Mustache extra_extensions: + - hogan - hulk - hjs - - mustache - - njk - - hogan +- name: html.handlebars + linguist: Handlebars + extra_extensions: - hdbs - hb --- @@ -770,8 +769,6 @@ remote: b4b4r07/vim-hcl filetypes: - name: hcl linguist: HCL - extra_extensions: - - nomad extra_filenames: - Appfile ignored_extensions: @@ -873,15 +870,14 @@ filetypes: - Jenkinsfile - Jenkinsfile* --- -name: jinja -remote: lepture/vim-jinja +name: htmldjango +remote: vim/vim:runtime +globs: +- '**/django.vim' +- '**/htmldjango.vim' filetypes: -- name: jinja.html +- name: htmldjango linguist: HTML+Django - extra_extensions: - - j2 - ignored_extensions: - - njk ignore_warnings: # handled by mustache plugin - mustache @@ -1437,7 +1433,9 @@ filetypes: - '*_spec.rb' --- name: yard -remote: sheerun/vim-yardoc +remote: noprompt/vim-yardoc +patches: +- 'https://github.com/sheerun/vim-yardoc/commit/173924ec12a66e26a886e80431b92cc9bda578d4.patch' # just adds to ruby filetypes: [] --- @@ -1727,6 +1725,9 @@ filetypes: linguist: XML extra_extensions: - cdxml + - tpm + - csproj.user + - wpl ignored_extensions: - ts - tsx @@ -1863,6 +1864,9 @@ glob: '**/bzl.vim' filetypes: - name: bzl linguist: Starlark + extra_extensions: + - bazel + - BUILD --- name: prolog remote: vim/vim:runtime diff --git a/scripts/build b/scripts/build index 47a7e51a..260beddb 100755 --- a/scripts/build +++ b/scripts/build @@ -375,13 +375,15 @@ def extract(packages) if repo == "vim/vim" && (["glob", "globs"] & package.keys).size == 0 raise "Package from vim/vim should define glob or globs: #{package["name"]}" end - glob = package.fetch("glob", package.fetch('globs', '**/*.{vim,ctags,vital,txt}')) - Dir.glob("#{subdir}/#{glob}", base: subtree).each do |p| - next unless File.file?("#{subtree}/#{p}") - if p.include?("samba") - raise package["name"] + globs = [package.fetch("glob", package.fetch('globs', '**/*.{vim,ctags,vital,txt}'))].flatten + globs.each do |glob| + Dir.glob("#{subdir}/#{glob}", base: subtree).each do |p| + next unless File.file?("#{subtree}/#{p}") + if p.include?("samba") + raise package["name"] + end + copy_file(package, "#{subtree}/#{p}", p) end - copy_file(package, "#{subtree}/#{p}", p) end elsif File.exist?(subpath) copy_file(package, subpath, subdir) diff --git a/syntax/aspperl.vim b/syntax/aspperl.vim new file mode 100644 index 00000000..18933caf --- /dev/null +++ b/syntax/aspperl.vim @@ -0,0 +1,29 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aspperl') == -1 + +" Vim syntax file +" Language: Active State's PerlScript (ASP) +" Maintainer: Aaron Hope +" URL: http://nim.dhs.org/~edh/aspperl.vim +" Last Change: 2001 May 09 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'perlscript' +endif + +runtime! syntax/html.vim +unlet b:current_syntax +syn include @AspPerlScript syntax/perl.vim + +syn cluster htmlPreproc add=AspPerlScriptInsideHtmlTags + +syn region AspPerlScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<%=\=+ skip=+".*%>.*"+ end=+%>+ contains=@AspPerlScript +syn region AspPerlScriptInsideHtmlTags keepend matchgroup=Delimiter start=+]*>+ end=++ contains=@AspPerlScript + +let b:current_syntax = "aspperl" + +endif diff --git a/syntax/aspvbs.vim b/syntax/aspvbs.vim new file mode 100644 index 00000000..d9cf40c6 --- /dev/null +++ b/syntax/aspvbs.vim @@ -0,0 +1,186 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aspvbs') == -1 + +" Vim syntax file +" Language: Microsoft VBScript Web Content (ASP) +" Maintainer: Devin Weaver (non-functional) +" URL: http://tritarget.com/pub/vim/syntax/aspvbs.vim (broken) +" Last Change: 2006 Jun 19 +" by Dan Casey +" Version: $Revision: 1.3 $ +" Thanks to Jay-Jay for a syntax sync hack, hungarian +" notation, and extra highlighting. +" Thanks to patrick dehne for the folding code. +" Thanks to Dean Hall for testing the use of classes in +" VBScripts which I've been too scared to do. + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'aspvbs' +endif + +runtime! syntax/html.vim +unlet b:current_syntax + +syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags + + +" Colored variable names, if written in hungarian notation +hi def AspVBSVariableSimple term=standout ctermfg=3 guifg=#99ee99 +hi def AspVBSVariableComplex term=standout ctermfg=3 guifg=#ee9900 +syn match AspVBSVariableSimple contained "\<\(bln\|byt\|dtm\=\|dbl\|int\|str\)\u\w*" +syn match AspVBSVariableComplex contained "\<\(arr\|ary\|obj\)\u\w*" + + +" Functions and methods that are in VB but will cause errors in an ASP page +" This is helpfull if your porting VB code to ASP +" I removed (Count, Item) because these are common variable names in AspVBScript +syn keyword AspVBSError contained Val Str CVar CVDate DoEvents GoSub Return GoTo +syn keyword AspVBSError contained Stop LinkExecute Add Type LinkPoke +syn keyword AspVBSError contained LinkRequest LinkSend Declare Optional Sleep +syn keyword AspVBSError contained ParamArray Static Erl TypeOf Like LSet RSet Mid StrConv +" It may seem that most of these can fit into a keyword clause but keyword takes +" priority over all so I can't get the multi-word matches +syn match AspVBSError contained "\" +syn match AspVBSError contained "^\s*Open\s\+" +syn match AspVBSError contained "Debug\.[a-zA-Z0-9_]*" +syn match AspVBSError contained "^\s*[a-zA-Z0-9_]\+:" +syn match AspVBSError contained "[a-zA-Z0-9_]\+![a-zA-Z0-9_]\+" +syn match AspVBSError contained "^\s*#.*$" +syn match AspVBSError contained "\\|\" +syn match AspVBSError contained "\\|\\|\\|\\|\" +syn match AspVBSError contained "\" +" This one I want 'cause I always seem to mis-spell it. +syn match AspVBSError contained "Respon\?ce\.\S*" +syn match AspVBSError contained "Respose\.\S*" +" When I looked up the VBScript syntax it mentioned that Property Get/Set/Let +" statements are illegal, however, I have recived reports that they do work. +" So I commented it out for now. +" syn match AspVBSError contained "\" + +" AspVBScript Reserved Words. +syn match AspVBSStatement contained "\\|\" +syn match AspVBSStatement contained "\" +syn match AspVBSStatement contained "\" +syn match AspVBSStatement contained "\" +syn match AspVBSStatement contained "\" +syn match AspVBSStatement contained "\\|\" +syn match AspVBSStatement contained "\" +syn keyword AspVBSStatement contained Call Class Const Default Dim Do Loop Erase And +syn keyword AspVBSStatement contained Function If Then Else ElseIf Or +syn keyword AspVBSStatement contained Private Public Randomize ReDim +syn keyword AspVBSStatement contained Select Case Sub While With Wend Not + +" AspVBScript Functions +syn keyword AspVBSFunction contained Abs Array Asc Atn CBool CByte CCur CDate CDbl +syn keyword AspVBSFunction contained Chr CInt CLng Cos CreateObject CSng CStr Date +syn keyword AspVBSFunction contained DateAdd DateDiff DatePart DateSerial DateValue +syn keyword AspVBSFunction contained Date Day Exp Filter Fix FormatCurrency +syn keyword AspVBSFunction contained FormatDateTime FormatNumber FormatPercent +syn keyword AspVBSFunction contained GetObject Hex Hour InputBox InStr InStrRev Int +syn keyword AspVBSFunction contained IsArray IsDate IsEmpty IsNull IsNumeric +syn keyword AspVBSFunction contained IsObject Join LBound LCase Left Len LoadPicture +syn keyword AspVBSFunction contained Log LTrim Mid Minute Month MonthName MsgBox Now +syn keyword AspVBSFunction contained Oct Replace RGB Right Rnd Round RTrim +syn keyword AspVBSFunction contained ScriptEngine ScriptEngineBuildVersion +syn keyword AspVBSFunction contained ScriptEngineMajorVersion +syn keyword AspVBSFunction contained ScriptEngineMinorVersion Second Sgn Sin Space +syn keyword AspVBSFunction contained Split Sqr StrComp StrReverse String Tan Time Timer +syn keyword AspVBSFunction contained TimeSerial TimeValue Trim TypeName UBound UCase +syn keyword AspVBSFunction contained VarType Weekday WeekdayName Year + +" AspVBScript Methods +syn keyword AspVBSMethods contained Add AddFolders BuildPath Clear Close Copy +syn keyword AspVBSMethods contained CopyFile CopyFolder CreateFolder CreateTextFile +syn keyword AspVBSMethods contained Delete DeleteFile DeleteFolder DriveExists +syn keyword AspVBSMethods contained Exists FileExists FolderExists +syn keyword AspVBSMethods contained GetAbsolutePathName GetBaseName GetDrive +syn keyword AspVBSMethods contained GetDriveName GetExtensionName GetFile +syn keyword AspVBSMethods contained GetFileName GetFolder GetParentFolderName +syn keyword AspVBSMethods contained GetSpecialFolder GetTempName Items Keys Move +syn keyword AspVBSMethods contained MoveFile MoveFolder OpenAsTextStream +syn keyword AspVBSMethods contained OpenTextFile Raise Read ReadAll ReadLine Remove +syn keyword AspVBSMethods contained RemoveAll Skip SkipLine Write WriteBlankLines +syn keyword AspVBSMethods contained WriteLine +syn match AspVBSMethods contained "Response\.\w*" +" Colorize boolean constants: +syn keyword AspVBSMethods contained true false + +" AspVBScript Number Contstants +" Integer number, or floating point number without a dot. +syn match AspVBSNumber contained "\<\d\+\>" +" Floating point number, with dot +syn match AspVBSNumber contained "\<\d\+\.\d*\>" +" Floating point number, starting with a dot +syn match AspVBSNumber contained "\.\d\+\>" + +" String and Character Contstants +" removed (skip=+\\\\\|\\"+) because VB doesn't have backslash escaping in +" strings (or does it?) +syn region AspVBSString contained start=+"+ end=+"+ keepend + +" AspVBScript Comments +syn region AspVBSComment contained start="^REM\s\|\sREM\s" end="$" contains=AspVBSTodo keepend +syn region AspVBSComment contained start="^'\|\s'" end="$" contains=AspVBSTodo keepend +" misc. Commenting Stuff +syn keyword AspVBSTodo contained TODO FIXME + +" Cosmetic syntax errors commanly found in VB but not in AspVBScript +" AspVBScript doesn't use line numbers +syn region AspVBSError contained start="^\d" end="\s" keepend +" AspVBScript also doesn't have type defining variables +syn match AspVBSError contained "[a-zA-Z0-9_][\$&!#]"ms=s+1 +" Since 'a%' is a VB variable with a type and in AspVBScript you can have 'a%>' +" I have to make a special case so 'a%>' won't show as an error. +syn match AspVBSError contained "[a-zA-Z0-9_]%\($\|[^>]\)"ms=s+1 + +" Top Cluster +syn cluster AspVBScriptTop contains=AspVBSStatement,AspVBSFunction,AspVBSMethods,AspVBSNumber,AspVBSString,AspVBSComment,AspVBSError,AspVBSVariableSimple,AspVBSVariableComplex + +" Folding +syn region AspVBSFold start="^\s*\(class\)\s\+.*$" end="^\s*end\s\+\(class\)\>.*$" fold contained transparent keepend +syn region AspVBSFold start="^\s*\(private\|public\)\=\(\s\+default\)\=\s\+\(sub\|function\)\s\+.*$" end="^\s*end\s\+\(function\|sub\)\>.*$" fold contained transparent keepend + +" Define AspVBScript delimeters +" <%= func("string_with_%>_in_it") %> This is illegal in ASP syntax. +syn region AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<%=\=+ end=+%>+ contains=@AspVBScriptTop, AspVBSFold +syn region AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+]*\s\+runatserver[^>]*>+ end=++ contains=@AspVBScriptTop + + +" Synchronization +" syn sync match AspVBSSyncGroup grouphere AspVBScriptInsideHtmlTags "<%" +" This is a kludge so the HTML will sync properly +syn sync match htmlHighlight grouphere htmlTag "%>" + + + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +"hi def link AspVBScript Special +hi def link AspVBSLineNumber Comment +hi def link AspVBSNumber Number +hi def link AspVBSError Error +hi def link AspVBSStatement Statement +hi def link AspVBSString String +hi def link AspVBSComment Comment +hi def link AspVBSTodo Todo +hi def link AspVBSFunction Identifier +hi def link AspVBSMethods PreProc +hi def link AspVBSEvents Special +hi def link AspVBSTypeSpecifier Type + + +let b:current_syntax = "aspvbs" + +if main_syntax == 'aspvbs' + unlet main_syntax +endif + +" vim: ts=8:sw=2:sts=0:noet + +endif diff --git a/syntax/django.vim b/syntax/django.vim new file mode 100644 index 00000000..b11caa98 --- /dev/null +++ b/syntax/django.vim @@ -0,0 +1,87 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'htmldjango') == -1 + +" Vim syntax file +" Language: Django template +" Maintainer: Dave Hodder +" Last Change: 2014 Jul 13 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syntax case match + +" Mark illegal characters +syn match djangoError "%}\|}}\|#}" + +" Django template built-in tags and parameters +" 'comment' doesn't appear here because it gets special treatment +syn keyword djangoStatement contained autoescape csrf_token empty +" FIXME ==, !=, <, >, <=, and >= should be djangoStatements: +" syn keyword djangoStatement contained == != < > <= >= +syn keyword djangoStatement contained and as block endblock by cycle debug else elif +syn keyword djangoStatement contained extends filter endfilter firstof for +syn keyword djangoStatement contained endfor if endif ifchanged endifchanged +syn keyword djangoStatement contained ifequal endifequal ifnotequal +syn keyword djangoStatement contained endifnotequal in include load not now or +syn keyword djangoStatement contained parsed regroup reversed spaceless +syn keyword djangoStatement contained endspaceless ssi templatetag openblock +syn keyword djangoStatement contained closeblock openvariable closevariable +syn keyword djangoStatement contained openbrace closebrace opencomment +syn keyword djangoStatement contained closecomment widthratio url with endwith +syn keyword djangoStatement contained get_current_language trans noop blocktrans +syn keyword djangoStatement contained endblocktrans get_available_languages +syn keyword djangoStatement contained get_current_language_bidi plural + +" Django templete built-in filters +syn keyword djangoFilter contained add addslashes capfirst center cut date +syn keyword djangoFilter contained default default_if_none dictsort +syn keyword djangoFilter contained dictsortreversed divisibleby escape escapejs +syn keyword djangoFilter contained filesizeformat first fix_ampersands +syn keyword djangoFilter contained floatformat get_digit join last length length_is +syn keyword djangoFilter contained linebreaks linebreaksbr linenumbers ljust +syn keyword djangoFilter contained lower make_list phone2numeric pluralize +syn keyword djangoFilter contained pprint random removetags rjust slice slugify +syn keyword djangoFilter contained safe safeseq stringformat striptags +syn keyword djangoFilter contained time timesince timeuntil title truncatechars +syn keyword djangoFilter contained truncatewords truncatewords_html unordered_list upper urlencode +syn keyword djangoFilter contained urlize urlizetrunc wordcount wordwrap yesno + +" Keywords to highlight within comments +syn keyword djangoTodo contained TODO FIXME XXX + +" Django template constants (always surrounded by double quotes) +syn region djangoArgument contained start=/"/ skip=/\\"/ end=/"/ + +" Mark illegal characters within tag and variables blocks +syn match djangoTagError contained "#}\|{{\|[^%]}}\|[&#]" +syn match djangoVarError contained "#}\|{%\|%}\|[<>!&#%]" + +" Django template tag and variable blocks +syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display +syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display + +" Django template 'comment' tag and comment block +syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo +syn region djangoComBlock start="{#" end="#}" contains=djangoTodo + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +hi def link djangoTagBlock PreProc +hi def link djangoVarBlock PreProc +hi def link djangoStatement Statement +hi def link djangoFilter Identifier +hi def link djangoArgument Constant +hi def link djangoTagError Error +hi def link djangoVarError Error +hi def link djangoError Error +hi def link djangoComment Comment +hi def link djangoComBlock Comment +hi def link djangoTodo Todo + + +let b:current_syntax = "django" + +endif diff --git a/syntax/handlebars.vim b/syntax/handlebars.vim new file mode 100644 index 00000000..52c2913a --- /dev/null +++ b/syntax/handlebars.vim @@ -0,0 +1,110 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 + +" Mustache & Handlebars syntax +" Language: Mustache, Handlebars +" Maintainer: Juvenn Woo +" Screenshot: http://imgur.com/6F408 +" Version: 6 +" Last Change: Jul 16 2019 +" Remark: +" It lexically hilights embedded mustaches (exclusively) in html file. +" While it was written for Ruby-based Mustache template system, it should +" work for Google's C-based *ctemplate* as well as Erlang-based *et*. All +" of them are, AFAIK, based on the idea of ctemplate. +" References: +" [Mustache](http://github.com/defunkt/mustache) +" [Handlebars](https://github.com/wycats/handlebars.js) +" [ctemplate](http://code.google.com/p/google-ctemplate/) +" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html) +" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html) +" TODO: Feedback is welcomed. + + +" Read the HTML syntax to start with +if version < 600 + so :p:h/html.vim +else + runtime! syntax/html.vim + unlet b:current_syntax +endif + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Standard HiLink will not work with included syntax files +if version < 508 + command! -nargs=+ HtmlHiLink hi link +else + command! -nargs=+ HtmlHiLink hi def link +endif + +syntax match mustacheError '}}}\?' +syntax match mustacheInsideError '{{[{$#<>=!\/]\?' + +" Ember angle bracket syntax syntax starts with a capital letter: +" https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md +syntax case match +syntax region mustacheAngleComponent start=/<\/\?[[:upper:]]/ end=/>/ keepend containedin=TOP,@htmlMustacheContainer +syntax case ignore +syntax match mustacheAngleBrackets '' contained containedin=mustacheAngleComponent +syntax match mustacheAngleComponentName '' contained containedin=@mustacheInside,mustacheParam +syntax region mustacheHtmlValue start=/={{[^!][$#^/]\?/rs=s+1,hs=s+1 end=/}}/ oneline keepend contained containedin=htmlTag contains=@mustacheInside +syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=@mustacheInside,@htmlMustacheContainer +syntax region mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=@mustacheInside,@htmlMustacheContainer +syntax match mustacheHandlebars '{{\|}}' contained containedin=@mustacheInside +syntax match mustacheUnescape '{{{\|}}}' contained containedin=@mustacheInside +syntax match mustacheConditionals '\([/#]\?\<\(if\|unless\)\|\' contained containedin=@mustacheInside +syntax match mustacheHelpers '[/#]\?\<\(with\|link\-to\|each\(\-in\)\?\|let\)\>' contained containedin=@mustacheInside +syntax match mustacheHelpers 'else \(if\|unless\|with\|link\-to\|each\(\-in\)\?\)' contained containedin=@mustacheInside +syntax match mustacheParam /[a-z@_-]\+=/he=e-1 contained containedin=@mustacheInside +syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=TOP,@mustacheInside,@htmlMustacheContainer +syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=TOP,@mustacheInside,@htmlMustacheContainer +syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=@mustacheInside +syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=@mustacheInside + +" Clustering +syntax cluster htmlMustacheContainer add=htmlHead,htmlTitle,htmlString,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlLink,htmlBold,htmlUnderline,htmlItalic,htmlValue + + +" Hilighting +" mustacheInside hilighted as Number, which is rarely used in html +" you might like change it to Function or Identifier +HtmlHiLink mustacheVariable Number +HtmlHiLink mustacheVariableUnescape Number +HtmlHiLink mustachePartial Number +HtmlHiLink mustacheMarkerSet Number +HtmlHiLink mustacheParam htmlArg +HtmlHiLink mustacheAngleComponentName htmlTag + +HtmlHiLink mustacheComment Comment +HtmlHiLink mustacheBlockComment Comment +HtmlHiLink mustacheError Error +HtmlHiLink mustacheInsideError Error + +HtmlHiLink mustacheHandlebars Special +HtmlHiLink mustacheAngleBrackets htmlTagName +HtmlHiLink mustacheUnescape Identifier +HtmlHiLink mustacheOperators Operator +HtmlHiLink mustacheConditionals Conditional +HtmlHiLink mustacheHelpers Repeat +HtmlHiLink mustacheQString String +HtmlHiLink mustacheDQString String + +syn region mustacheScriptTemplate start=++me=s-1 keepend +\ contains=mustacheInside,@htmlMustacheContainer,htmlTag,htmlEndTag,htmlTagName,htmlSpecialChar + +let b:current_syntax = "handlebars" +delcommand HtmlHiLink + +endif diff --git a/syntax/html-1.vim b/syntax/html-1.vim deleted file mode 100644 index 633a157e..00000000 --- a/syntax/html-1.vim +++ /dev/null @@ -1,196 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1 - -" Vim syntax file -" Language: HTML (version 5.1) -" SVG (SVG 1.1 Second Edition) -" MathML (MathML 3.0 Second Edition) -" Last Change: 2017 Mar 07 -" License: Public domain -" (but let me know if you like :) ) -" -" Note: This file just add new tags from HTML 5 -" and don't replace default html.vim syntax file -" -" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com ) -" Changes: update to Draft 2016 Jan 13 -" add microdata Attributes -" Maintainer: Rodrigo Machado -" URL: http://rm.blog.br/vim/syntax/html.vim -" Modified: htdebeer -" Changes: add common SVG elements and attributes for inline SVG - -" Patch 7.4.1142 -if has("patch-7.4-1142") - if has("win32") - syn iskeyword @,48-57,_,128-167,224-235,- - else - syn iskeyword @,48-57,_,192-255,- - endif -endif - -" 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 menuitem nav output -syn keyword htmlTagName contained progress ruby rt rp rb rtc section source summary time track video data -syn keyword htmlTagName contained template content shadow slot -syn keyword htmlTagName contained wbr bdi -syn keyword htmlTagName contained picture - -" 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 -syn keyword htmlTagName contained metadata title - -" MathML tags -" https://www.w3.org/TR/MathML3/appendixi.html#index.elem -syn keyword htmlTagName contained abs and annotation annotation-xml apply approx arccos arccosh arccot arccoth -syn keyword htmlTagName contained arccsc arccsch arcsec arcsech arcsin arcsinh arctan arctanh arg bind -syn keyword htmlTagName contained bvar card cartesianproduct cbytes ceiling cerror ci cn codomain complexes -syn keyword htmlTagName contained compose condition conjugate cos cosh cot coth cs csc csch -syn keyword htmlTagName contained csymbol curl declare degree determinant diff divergence divide domain domainofapplication -syn keyword htmlTagName contained emptyset eq equivalent eulergamma exists exp exponentiale factorial factorof false -syn keyword htmlTagName contained floor fn forall gcd geq grad gt ident image imaginary -syn keyword htmlTagName contained imaginaryi implies in infinity int integers intersect interval inverse lambda -syn keyword htmlTagName contained laplacian lcm leq limit list ln log logbase lowlimit lt -syn keyword htmlTagName contained maction maligngroup malignmark math matrix matrixrow max mean median menclose -syn keyword htmlTagName contained merror mfenced mfrac mglyph mi mi" min minus mlabeledtr mlongdiv -syn keyword htmlTagName contained mmultiscripts mn mo mode moment momentabout mover mpadded mphantom mprescripts -syn keyword htmlTagName contained mroot mrow ms mscarries mscarry msgroup msline mspace msqrt msrow -syn keyword htmlTagName contained mstack mstyle msub msubsup msup mtable mtd mtext mtr munder -syn keyword htmlTagName contained munderover naturalnumbers neq none not notanumber notin notprsubset notsubset or -syn keyword htmlTagName contained otherwise outerproduct partialdiff pi piece piecewise plus power primes product -syn keyword htmlTagName contained prsubset quotient rationals real reals reln rem root scalarproduct sdev -syn keyword htmlTagName contained sec sech selector semantics sep set setdiff share sin sinh -syn keyword htmlTagName contained span subset sum tan tanh tendsto times transpose true union -syn keyword htmlTagName contained uplimit variance vector vectorproduct xor - -" Custom Element -syn match htmlTagName contained "\<[a-z][-.0-9_a-z]*-[-.0-9_a-z]*\>" -syn match htmlTagName contained "[.0-9_a-z]\@<=-[-.0-9_a-z]*\>" - -" HTML 5 arguments -" Core Attributes -syn keyword htmlArg contained accesskey class contenteditable contextmenu dir -syn keyword htmlArg contained draggable hidden id is 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 -" -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 -"