Compare commits

...

4 Commits

Author SHA1 Message Date
Adam Stankiewicz
9243367ba3 Automatically detect script filetype when typing 2020-09-10 15:40:27 +02:00
Adam Stankiewicz
1eed30b2af Fix filetype detection and docini filetypes 2020-09-10 14:07:02 +02:00
Adam Stankiewicz
be092d6f43 Fix jsx indentation, closes #543 2020-09-10 12:18:29 +02:00
Adam Stankiewicz
fb7cf8a9ab Update 2020-09-10 10:30:32 +02:00
31 changed files with 861 additions and 621 deletions

View File

@@ -7,4 +7,4 @@ test:
@ scripts/test
dev:
@ echo "packages.yaml\nheuristics.yaml\nscripts/test\nscripts/build\nscripts/test_extensions.vim" | DEV=1 entr bash -c 'make && make test'
@ (ls && find scripts) | DEV=1 entr bash -c 'make && make test'

View File

@@ -7,7 +7,7 @@ A collection of language packs for Vim.
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
- It **installs and updates 120+ times faster** than the <!--Package Count-->194<!--/Package Count--> packages it consists of.
- It **installs and updates 120+ times faster** than the <!--Package Count-->195<!--/Package Count--> packages it consists of.
- It is more secure because scripts loaded for all extensions are generated by vim-polyglot (ftdetect).
- Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support).
@@ -98,6 +98,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [dhall](https://github.com/vmchale/dhall-vim)
- [dlang](https://github.com/JesseKPhillips/d.vim)
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim)
- [dosini](https://github.com/vim/vim/tree/master/runtime)
- [elf](https://github.com/vim/vim/tree/master/runtime)
- [elixir](https://github.com/elixir-lang/vim-elixir)
- [elm](https://github.com/andys8/vim-elm-syntax)

View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
" Vim filetype plugin file
" Language: JavaScript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
setlocal iskeyword+=$ suffixesadd+=.js
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
endif

View File

@@ -0,0 +1,9 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
if get(g:, 'vim_jsx_pretty_disable_js', 0)
finish
endif
source <sfile>:h/jsx.vim
endif

View File

@@ -1,51 +1,3 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
" Vim filetype plugin file
" Language: JavaScript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
setlocal iskeyword+=$ suffixesadd+=.js
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
endif
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftplugin file
"
" Language: javascript.jsx
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" modified from html.vim
" For matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
endif
" For andymass/vim-matchup plugin
if exists("loaded_matchup")
setlocal matchpairs=(:),{:},[:],<:>
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_skip = 's:comment\|string'
endif
let b:jsx_pretty_old_cms = &l:commentstring
augroup jsx_comment
autocmd! CursorMoved <buffer>
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
augroup end
setlocal suffixesadd+=.jsx
endif
" Polyglot metafile
source <sfile>:h/javascript-1.vim
source <sfile>:h/javascript-2.vim

View File

@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/javascript.vim
source <sfile>:h/jsx.vim
endif

35
after/ftplugin/jsx.vim Normal file
View File

@@ -0,0 +1,35 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftplugin file
"
" Language: javascript.jsx
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" modified from html.vim
" For matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
endif
" For andymass/vim-matchup plugin
if exists("loaded_matchup")
setlocal matchpairs=(:),{:},[:],<:>
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_skip = 's:comment\|string'
endif
let b:jsx_pretty_old_cms = &l:commentstring
augroup jsx_comment
autocmd! CursorMoved <buffer>
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
augroup end
setlocal suffixesadd+=.jsx
endif

View File

@@ -1,80 +1,9 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
" Copyright (c) 2016-2020 Jon Parise <jon@indelible.org>
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to
" deal in the Software without restriction, including without limitation the
" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
" sell copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
"
" The above copyright notice and this permission notice shall be included in
" all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
" IN THE SOFTWARE.
"
" Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org>
runtime! indent/graphql.vim
" Don't redefine our function and also require the standard Javascript indent
" function to exist.
if exists('*GetJavascriptGraphQLIndent') || !exists('*GetJavascriptIndent')
if get(g:, 'vim_jsx_pretty_disable_js', 0)
finish
endif
" Set the indentexpr with our own version that will call GetGraphQLIndent when
" we're inside of a GraphQL string and otherwise defer to GetJavascriptIndent.
setlocal indentexpr=GetJavascriptGraphQLIndent()
function GetJavascriptGraphQLIndent()
let l:stack = map(synstack(v:lnum, 1), "synIDattr(v:val,'name')")
if !empty(l:stack) && l:stack[0] ==# 'graphqlTemplateString'
return GetGraphQLIndent()
endif
return GetJavascriptIndent()
endfunction
endif
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim indent file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('b:did_indent')
let s:did_indent = b:did_indent
unlet b:did_indent
endif
let s:keepcpo = &cpo
set cpo&vim
if exists('s:did_indent')
let b:did_indent = s:did_indent
endif
setlocal indentexpr=GetJsxIndent()
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
function! GetJsxIndent()
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
source <sfile>:h/jsx.vim
endif

View File

@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/javascript.vim
source <sfile>:h/jsx.vim
endif

33
after/indent/jsx.vim Normal file
View File

@@ -0,0 +1,33 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim indent file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('b:did_indent')
let s:did_indent = b:did_indent
unlet b:did_indent
endif
let s:keepcpo = &cpo
set cpo&vim
if exists('s:did_indent')
let b:did_indent = s:did_indent
endif
setlocal indentexpr=GetJsxIndent()
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
function! GetJsxIndent()
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
endif

View File

@@ -1,47 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
" Copyright (c) 2016-2020 Jon Parise <jon@indelible.org>
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to
" deal in the Software without restriction, including without limitation the
" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
" sell copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
"
" The above copyright notice and this permission notice shall be included in
" all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
" IN THE SOFTWARE.
"
" Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org>
runtime! indent/graphql.vim
" Don't redefine our function and also require the standard Typescript indent
" function to exist.
if exists('*GetTypescriptGraphQLIndent') || !exists('*GetTypescriptIndent')
finish
endif
" Set the indentexpr with our own version that will call GetGraphQLIndent when
" we're inside of a GraphQL string and otherwise defer to GetTypescriptIndent.
setlocal indentexpr=GetTypescriptGraphQLIndent()
function GetTypescriptGraphQLIndent()
let l:stack = map(synstack(v:lnum, 1), "synIDattr(v:val,'name')")
if !empty(l:stack) && l:stack[0] ==# 'graphqlTemplateString'
return GetGraphQLIndent()
endif
return GetTypescriptIndent()
endfunction
endif

View File

@@ -1,59 +1,9 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim syntax file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:jsx_cpo = &cpo
set cpo&vim
syntax case match
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
if get(g:, 'vim_jsx_pretty_disable_js', 0)
finish
endif
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
syntax cluster jsExpression add=jsxRegion
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
" refine the javascript line comment
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
syntax cluster javascriptValue add=jsxRegion
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
else " build-in javascript syntax
" refine the javascript line comment
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
" refine the template string syntax
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
" add a javaScriptBlock group for build-in syntax
syntax region javaScriptBlock
\ matchgroup=javaScriptBraces
\ start="{"
\ end="}"
\ contained
\ extend
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
\ fold
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
endif
runtime syntax/jsx_pretty.vim
let b:current_syntax = 'javascript.jsx'
let &cpo = s:jsx_cpo
unlet s:jsx_cpo
source <sfile>:h/jsx.vim
endif

View File

@@ -1,5 +1,5 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
source <sfile>:h/javascript.vim
source <sfile>:h/jsx.vim
endif

59
after/syntax/jsx.vim Normal file
View File

@@ -0,0 +1,59 @@
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim syntax file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:jsx_cpo = &cpo
set cpo&vim
syntax case match
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
syntax cluster jsExpression add=jsxRegion
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
" refine the javascript line comment
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
syntax cluster javascriptValue add=jsxRegion
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
else " build-in javascript syntax
" refine the javascript line comment
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
" refine the template string syntax
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
" add a javaScriptBlock group for build-in syntax
syntax region javaScriptBlock
\ matchgroup=javaScriptBraces
\ start="{"
\ end="}"
\ contained
\ extend
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
\ fold
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
endif
runtime syntax/jsx_pretty.vim
let b:current_syntax = 'javascript.jsx'
let &cpo = s:jsx_cpo
unlet s:jsx_cpo
endif

View File

@@ -32,6 +32,6 @@ if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax region graphqlMultilineString matchgroup=reasonMultilineString start=+graphql\_s*\zs{|+ end=+|}+ contains=@GraphQLSyntax,reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation keepend
syntax region graphqlExtensionPoint matchgroup=Noise start=+\[%graphql\_s*{|+lc=10 end=+|}\_s*]+he=s+1 contains=@GraphQLSyntax keepend
endif

View File

@@ -552,6 +552,14 @@ function! go#config#GoplsLocal() abort
return get(g:, 'go_gopls_local', v:null)
endfunction
function! go#config#GoplsGofumpt() abort
return get(g:, 'go_gopls_gofumpt', v:null)
endfunction
function! go#config#GoplsSettings() abort
return get(g:, 'go_gopls_settings', v:null)
endfunction
function! go#config#GoplsEnabled() abort
return get(g:, 'go_gopls_enabled', 1)
endfunction

View File

@@ -4,11 +4,13 @@ set cpo&vim
func! polyglot#Heuristics()
" Try to detect filetype from shebang
let l:filetype = polyglot#Shebang()
if l:filetype != ""
exec "setf " . l:filetype
return
let filetype = polyglot#Shebang()
if filetype != ""
exec "setf " . filetype
return 1
endif
return 0
endfunc
let s:interpreters = {
@@ -86,37 +88,41 @@ let s:r_envflag = '%(\S\+=\S\+\|-[iS]\|--ignore-environment\|--split-string\)'
let s:r_env = '^\%(\' . s:r_envflag . '\s\+\)*\(\S\+\)'
func! polyglot#Shebang()
let l:line1 = getline(1)
let line1 = getline(1)
if l:line1 !~# "^#!"
if line1 !~# "^#!"
return
endif
let l:pathrest = matchlist(l:line1, s:r_hashbang)
let pathrest = matchlist(line1, s:r_hashbang)
if len(l:pathrest) == 0
if len(pathrest) == 0
return
endif
let [_, l:path, l:rest; __] = l:pathrest
let [_, path, rest; __] = pathrest
let l:script = split(l:path, "/")[-1]
let script = split(path, "/")[-1]
if l:script == "env"
let l:argspath = matchlist(l:rest, s:r_env)
if len(l:argspath) == 0
if len(script) == 0
return
endif
if script == "env"
let argspath = matchlist(rest, s:r_env)
if len(argspath) == 0
return
endif
let l:script = l:argspath[1]
let script = argspath[1]
endif
if has_key(s:interpreters, l:script)
return s:interpreters[l:script]
if has_key(s:interpreters, script)
return s:interpreters[script]
endif
for interpreter in keys(s:interpreters)
if l:script =~# '^' . interpreter
if script =~# '^' . interpreter
return s:interpreters[interpreter]
endif
endfor

View File

@@ -57,7 +57,7 @@ let s:globs = {
\ 'dd': '*.dd',
\ 'ddoc': '*.ddoc',
\ 'dhall': '*.dhall',
\ 'dosini': '*.wrap',
\ 'dosini': '*.wrap,*.ini,*.cfg,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,php.ini-*',
\ 'dsdl': '*.sdl',
\ 'dune': 'jbuild,dune,dune-project,dune-workspace',
\ 'ecrystal': '*.ecr',
@@ -110,7 +110,7 @@ let s:globs = {
\ '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',
\ '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',
\ 'jsonnet': '*.jsonnet,*.libsonnet',
\ 'jst': '*.ejs,*.ect,*.jst',
@@ -130,7 +130,7 @@ let s:globs = {
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook,contents.lr',
\ 'markdown.mdx': '*.mdx',
\ 'meson': 'meson.build,meson_options.txt',
\ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls',
\ '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',

View File

@@ -46,8 +46,7 @@ the list of recognized template tag names.
REASONML *graphql-reasonml*
GraphQL syntax support inside of ReasonML template strings using graphql-ppx
is available when vim-reasonml (https://github.com/jordwalke/vim-reasonml) is
also installed.
is available.
------------------------------------------------------------------------------
vim:tw=78:ft=help:norl:

View File

@@ -802,7 +802,7 @@ CTRL-t
You can define a constant value instead of the default field based value.
For example the following command will add ``valid:"1"`` to all fields.
>
:GoAddTags valid=1
:GoAddTags valid:1
<
*:GoRemoveTags*
:[range]GoRemoveTags [key],[option] [key1],[option1] ...
@@ -1876,6 +1876,24 @@ is `v:null`.
let g:go_gopls_local = v:null
<
*'g:go_gopls_gofumpt'*
Specifies whether `gopls` should use `gofumpt` for formatting. When it is
`v:null`, `gopls`' default will be used. By default it is `v:null`.
>
let g:go_gopls_gofumpt = v:null
<
*'g:go_gopls_settings'*
Specifies `gopls` workspace settings for `gopls` that are not yet officially
supported by vim-go. Any value in the dictionary will be overridden by values
provided in the specific options supported by vim-go (e.g.
g:go_gopls_staticcheck) or settings statically configured by vim-go to ensure
expected behavior. By default it is `v:null`.
>
let g:go_gopls_settings = v:null
<
*'g:go_diagnostics_enabled'*
Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for

View File

@@ -46,6 +46,7 @@ CONFIG *vim-jsx-pretty-config*
|---------------------------------------|---------|----------------------|
| g:vim_jsx_pretty_enable_jsx_highlight | 1 | jsx highlight flag |
| g:vim_jsx_pretty_colorful_config | 0 | colorful config flag |
| g:vim_jsx_pretty_disable_js | 0 | js toggle flag |
<
- *g:vim_jsx_pretty_enable_jsx_highlight*

View File

@@ -73,6 +73,8 @@ func! s:StarSetf(ft)
endif
endfunc
augroup filetypedetect
" filetypes
if !has_key(s:disabled_packages, '8th')
@@ -95,12 +97,24 @@ if !has_key(s:disabled_packages, 'abc')
au! BufRead,BufNewFile *.abc
endif
if !has_key(s:disabled_packages, 'abel')
au! BufRead,BufNewFile *.abl
endif
if !has_key(s:disabled_packages, 'acedb')
au! BufRead,BufNewFile *.wrm
endif
if !has_key(s:disabled_packages, 'acpiasl')
au! BufRead,BufNewFile *.dsl
endif
if !has_key(s:disabled_packages, 'ada')
au! BufRead,BufNewFile *.ada
au! BufRead,BufNewFile *.adb,*.ads,*.ada,*.adc,*.gpr,*.ada_m
endif
if !has_key(s:disabled_packages, 'ahdl')
au! BufRead,BufNewFile *.tdf
endif
if !has_key(s:disabled_packages, 'aidl')
@@ -111,8 +125,16 @@ if !has_key(s:disabled_packages, 'aml')
au! BufRead,BufNewFile *.aml
endif
if !has_key(s:disabled_packages, 'ampl')
au! BufRead,BufNewFile *.run
endif
if !has_key(s:disabled_packages, 'applescript')
au! BufRead,BufNewFile *.applescript
au! BufRead,BufNewFile *.scpt
endif
if !has_key(s:disabled_packages, 'arduino')
au! BufRead,BufNewFile *.pde,*.ino
endif
if !has_key(s:disabled_packages, 'art')
@@ -120,11 +142,23 @@ if !has_key(s:disabled_packages, 'art')
endif
if !has_key(s:disabled_packages, 'asciidoc')
au! BufRead,BufNewFile *.asciidoc
au! BufRead,BufNewFile *.asciidoc,*.adoc
endif
if !has_key(s:disabled_packages, 'autohotkey')
au! BufRead,BufNewFile *.ahk
endif
if !has_key(s:disabled_packages, 'asn')
au! BufRead,BufNewFile *.asn
au! BufRead,BufNewFile *.asn,*.asn1
endif
if !has_key(s:disabled_packages, 'atlas')
au! BufRead,BufNewFile *.atl,*.as
endif
if !has_key(s:disabled_packages, 'autoit')
au! BufRead,BufNewFile *.au3
endif
if !has_key(s:disabled_packages, 'ave')
@@ -132,19 +166,27 @@ if !has_key(s:disabled_packages, 'ave')
endif
if !has_key(s:disabled_packages, 'awk')
au! BufRead,BufNewFile *.awk
au! BufRead,BufNewFile *.awk,*.gawk
endif
if !has_key(s:disabled_packages, 'c/c++')
au! BufRead,BufNewFile *.cpp,*.tpp,*.c
au! BufRead,BufNewFile *.cpp,*.c++,*.cc,*.cxx,*.hh,*.hpp,*.hxx,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh,*.qc
endif
if !has_key(s:disabled_packages, 'clojure')
au! BufRead,BufNewFile *.clj,*.cljc,*.cljs,*.cljx
endif
if !has_key(s:disabled_packages, 'cmake')
au! BufRead,BufNewFile *.cmake
au! BufRead,BufNewFile *.cmake,*.cmake.in
endif
if !has_key(s:disabled_packages, 'cucumber')
au! BufRead,BufNewFile *.feature
endif
if !has_key(s:disabled_packages, 'dart')
au! BufRead,BufNewFile *.dart
au! BufRead,BufNewFile *.dart,*.drt
endif
if !has_key(s:disabled_packages, 'dlang')
@@ -152,27 +194,43 @@ if !has_key(s:disabled_packages, 'dlang')
endif
if !has_key(s:disabled_packages, 'dockerfile')
au! BufRead,BufNewFile *.dockerfile
au! BufRead,BufNewFile *.Dockerfile
endif
if !has_key(s:disabled_packages, 'elf')
au! BufRead,BufNewFile *.am
endif
if !has_key(s:disabled_packages, 'elm')
au! BufRead,BufNewFile *.elm
endif
if !has_key(s:disabled_packages, 'git')
au! BufRead,BufNewFile *.gitconfig
if !has_key(s:disabled_packages, 'erlang')
au! BufRead,BufNewFile *.erl,*.es,*.hrl,*.yaws
endif
if !has_key(s:disabled_packages, 'forth')
au! BufRead,BufNewFile *.fs,*.ft,*.fth
endif
if !has_key(s:disabled_packages, 'fsharp')
au! BufRead,BufNewFile *.fs
endif
if !has_key(s:disabled_packages, 'glsl')
au! BufRead,BufNewFile *.fs,*.gs,*.comp
endif
if !has_key(s:disabled_packages, 'gnuplot')
au! BufRead,BufNewFile *.gp,*.gnuplot
au! BufRead,BufNewFile *.gp,*.gpi
endif
if !has_key(s:disabled_packages, 'go')
au! BufRead,BufNewFile *.go
au! BufRead,BufNewFile *.go,*.tmpl
endif
if !has_key(s:disabled_packages, 'groovy')
au! BufRead,BufNewFile *.groovy
au! BufRead,BufNewFile *.groovy,*.gradle
endif
if !has_key(s:disabled_packages, 'haml')
@@ -187,28 +245,56 @@ if !has_key(s:disabled_packages, 'haproxy')
au! BufRead,BufNewFile *.cfg
endif
if !has_key(s:disabled_packages, 'haskell')
au! BufRead,BufNewFile *.hs,*.hs-boot,*.hsc
endif
if !has_key(s:disabled_packages, 'html5')
au! BufRead,BufNewFile *.st,*.xhtml
au! BufRead,BufNewFile *.st,*.xht,*.xhtml
endif
if !has_key(s:disabled_packages, 'jsx')
au! BufRead,BufNewFile *.jsx
endif
if !has_key(s:disabled_packages, 'javascript')
au! BufRead,BufNewFile *.js,*.cjs,*.es,*.gs,*.mjs,*.pac
endif
if !has_key(s:disabled_packages, 'json')
au! BufRead,BufNewFile *.json,*.template
au! BufRead,BufNewFile *.json,*.ice,*.webmanifest,*.yy,*.jsonp
endif
if !has_key(s:disabled_packages, 'kotlin')
au! BufRead,BufNewFile *.kt,*.ktm,*.kts
endif
if !has_key(s:disabled_packages, 'less')
au! BufRead,BufNewFile *.less
endif
if !has_key(s:disabled_packages, 'llvm')
au! BufRead,BufNewFile *.ll
endif
if !has_key(s:disabled_packages, 'lua')
au! BufRead,BufNewFile *.lua
au! BufRead,BufNewFile *.lua,*.nse,*.rockspec
endif
if !has_key(s:disabled_packages, 'm4')
au! BufRead,BufNewFile *.m4
au! BufRead,BufNewFile *.m4,*.at
endif
if !has_key(s:disabled_packages, 'mathematica')
au! BufRead,BufNewFile *.cdf,*.nb
endif
if !has_key(s:disabled_packages, 'markdown')
au! BufRead,BufNewFile *.markdown
au! BufRead,BufNewFile *.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn
endif
if !has_key(s:disabled_packages, 'ocaml')
au! BufRead,BufNewFile *.ml,*.mli,*.mll,*.mly
endif
if !has_key(s:disabled_packages, 'opencl')
@@ -216,11 +302,11 @@ if !has_key(s:disabled_packages, 'opencl')
endif
if !has_key(s:disabled_packages, 'perl')
au! BufRead,BufNewFile *.perl
au! BufRead,BufNewFile *.al,*.plx,*.psgi,*.t
endif
if !has_key(s:disabled_packages, 'php')
au! BufRead,BufNewFile *.php
au! BufRead,BufNewFile *.php,*.ctp
endif
if !has_key(s:disabled_packages, 'protobuf')
@@ -228,15 +314,19 @@ if !has_key(s:disabled_packages, 'protobuf')
endif
if !has_key(s:disabled_packages, 'python')
au! BufRead,BufNewFile *.spec
au! BufRead,BufNewFile *.py,*.pyi,*.pyw,*.spec
endif
if !has_key(s:disabled_packages, 'r-lang')
au! BufRead,BufNewFile *.r
au! BufRead,BufNewFile *.s,*.S,*.rd
endif
if !has_key(s:disabled_packages, 'racket')
au! BufRead,BufNewFile *.rkt
endif
if !has_key(s:disabled_packages, 'raku')
au! BufRead,BufNewFile *.pod6
au! BufRead,BufNewFile *.p6,*.pl6,*.pm6,*.t,*.raku,*.rakumod,*.pod6
endif
if !has_key(s:disabled_packages, 'raml')
@@ -248,7 +338,11 @@ if !has_key(s:disabled_packages, 'rst')
endif
if !has_key(s:disabled_packages, 'ruby')
au! BufRead,BufNewFile *.ruby,*.spec
au! BufRead,BufNewFile *.rb,*.builder,*.gemspec,*.rake,*.rbw,*.ru,*.spec,*.rxml,*.rjs,*.rant,*.erb,*.rhtml
endif
if !has_key(s:disabled_packages, 'rust')
au! BufRead,BufNewFile *.rs
endif
if !has_key(s:disabled_packages, 'scala')
@@ -264,7 +358,11 @@ if !has_key(s:disabled_packages, 'scss')
endif
if !has_key(s:disabled_packages, 'sh')
au! BufRead,BufNewFile *.sh,*.tmux,*.zsh
au! BufRead,BufNewFile *.zsh
endif
if !has_key(s:disabled_packages, 'smt2')
au! BufRead,BufNewFile *.smt
endif
if !has_key(s:disabled_packages, 'svg')
@@ -283,24 +381,44 @@ if !has_key(s:disabled_packages, 'twig')
au! BufRead,BufNewFile *.twig
endif
if !has_key(s:disabled_packages, 'typescript')
au! BufRead,BufNewFile *.ts,*.tsx
endif
if !has_key(s:disabled_packages, 'v')
au! BufRead,BufNewFile *.v
endif
if !has_key(s:disabled_packages, 'vbnet')
au! BufRead,BufNewFile *.vb
endif
if !has_key(s:disabled_packages, 'vmasm')
au! BufRead,BufNewFile *.mar
endif
if !has_key(s:disabled_packages, 'vue')
au! BufRead,BufNewFile *.vue
endif
if !has_key(s:disabled_packages, 'xml')
au! BufRead,BufNewFile *.xml,*.ant,*.xsd
au! BufRead,BufNewFile *.csproj,*.ui,*.wsdl,*.wsf,*.xlf,*.xliff,*.xmi,*.xsd,*.xul
endif
if !has_key(s:disabled_packages, 'xsl')
au! BufRead,BufNewFile *.xslt
au! BufRead,BufNewFile *.xslt,*.xsl
endif
if !has_key(s:disabled_packages, 'yaml')
au! BufRead,BufNewFile *.yaml
au! BufRead,BufNewFile *.yml,*.yaml
endif
if !has_key(s:disabled_packages, 'visual-basic')
au! BufRead,BufNewFile *.vba,*.vbs,*.dsm,*.ctl,*.sba
endif
if !has_key(s:disabled_packages, 'dosini')
au! BufRead,BufNewFile *.ini,*.cfg,*.properties
endif
if !has_key(s:disabled_packages, '8th')
@@ -851,6 +969,10 @@ if !has_key(s:disabled_packages, 'ion')
au BufNewFile,BufRead ~/.config/ion/initrc setf ion
endif
if !has_key(s:disabled_packages, 'jsx')
au BufNewFile,BufRead *.jsx setf javascriptreact
endif
if !has_key(s:disabled_packages, 'javascript')
au BufNewFile,BufRead *._js setf javascript
au BufNewFile,BufRead *.bones setf javascript
@@ -924,6 +1046,7 @@ if !has_key(s:disabled_packages, 'json')
au BufNewFile,BufRead {.,}tern-config setf json
au BufNewFile,BufRead {.,}tern-project setf json
au BufNewFile,BufRead {.,}watchmanconfig setf json
au BufNewFile,BufRead Pipfile.lock setf json
au BufNewFile,BufRead composer.lock setf json
au BufNewFile,BufRead mcmod.info setf json
endif
@@ -939,10 +1062,6 @@ if !has_key(s:disabled_packages, 'jst')
au BufNewFile,BufRead *.jst setf jst
endif
if !has_key(s:disabled_packages, 'jsx')
au BufNewFile,BufRead *.jsx setf javascriptreact
endif
if !has_key(s:disabled_packages, 'julia')
au BufNewFile,BufRead *.jl setf julia
endif
@@ -1021,6 +1140,7 @@ if !has_key(s:disabled_packages, 'mathematica')
au BufNewFile,BufRead *.cdf setf mma
au BufNewFile,BufRead *.ma setf mma
au BufNewFile,BufRead *.mathematica setf mma
au BufNewFile,BufRead *.mma setf mma
au BufNewFile,BufRead *.mt setf mma
au BufNewFile,BufRead *.nb setf mma
au BufNewFile,BufRead *.nbp setf mma
@@ -1771,6 +1891,23 @@ if !has_key(s:disabled_packages, 'visual-basic')
au! BufNewFile,BufRead *.bas call polyglot#DetectBasFiletype()
endif
if !has_key(s:disabled_packages, 'dosini')
au BufNewFile,BufRead *.cfg setf dosini
au BufNewFile,BufRead *.dof setf dosini
au BufNewFile,BufRead *.ini setf dosini
au BufNewFile,BufRead *.lektorproject setf dosini
au BufNewFile,BufRead *.prefs setf dosini
au BufNewFile,BufRead *.pro setf dosini
au BufNewFile,BufRead *.properties setf dosini
au BufNewFile,BufRead */etc/pacman.conf setf dosini
au BufNewFile,BufRead */etc/yum.conf setf dosini
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
au BufNewFile,BufRead {.,}editorconfig setf dosini
au BufNewFile,BufRead {.,}npmrc setf dosini
au BufNewFile,BufRead buildozer.spec setf dosini
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
endif
" end filetypes
@@ -1778,6 +1915,7 @@ au BufNewFile,BufRead,StdinReadPost *
\ if !did_filetype() && expand("<afile>") !~ g:ft_ignore_pat
\ | call polyglot#Heuristics() | endif
augroup END
if !has_key(s:disabled_packages, 'autoindent')
" Code below re-implements sleuth for vim-polyglot
@@ -1949,10 +2087,10 @@ if !has_key(s:disabled_packages, 'autoindent')
endif
endfunction
augroup polyglot
autocmd!
autocmd FileType * call s:detect_indent()
autocmd User Flags call Hoist('buffer', 5, 'SleuthIndicator')
augroup polyglot-sleuth
au!
au FileType * call s:detect_indent()
au User Flags call Hoist('buffer', 5, 'SleuthIndicator')
augroup END
command! -bar -bang Sleuth call s:detect_indent()
@@ -1970,7 +2108,17 @@ func! s:verify()
endif
endfunc
autocmd VimEnter * call s:verify()
au VimEnter * call s:verify()
func! s:observe_filetype()
augroup polyglot-observer
au! CursorHold,CursorHoldI <buffer>
\ if polyglot#Heuristics() | au! polyglot-observer CursorHold,CursorHoldI | endif
augroup END
endfunc
au BufEnter * if &ft == "" && expand("<afile>") !~ g:ft_ignore_pat
\ | call s:observe_filetype() | endif
" restore Vi compatibility settings
let &cpo = s:cpo_save

23
ftplugin/dosini.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dosini') == -1
" Vim filetype plugin file
" Language: Configuration File (ini file) for MSDOS/MS Windows
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -679,6 +679,11 @@ filetypes:
---
name: graphql
remote: jparise/vim-graphql
after: [javascript, jsx]
ignored_dirs:
# TODO: remove after bug is fixed:
# https://github.com/jparise/vim-graphql/issues/62
- after/indent
filetypes:
- name: graphql
linguist: GraphQL
@@ -899,6 +904,8 @@ filetypes:
extra_extensions:
- jsonp
- template
extra_filenames:
- Pipfile.lock
---
name: jsonnet
remote: google/vim-jsonnet
@@ -921,6 +928,7 @@ filetypes:
---
name: jsx
remote: MaxMEllon/vim-jsx-pretty
after: javascript
filetypes:
- name: javascriptreact
linguist: JSX
@@ -1019,6 +1027,7 @@ filetypes:
linguist: Mathematica
extra_extensions:
- wls
- mma
---
name: markdown
remote: plasticboy/vim-markdown
@@ -1802,3 +1811,19 @@ filetypes:
- sba
ignored_warnings:
- vb
---
name: dosini
remote: vim/vim:runtime
glob: '**/dosini.vim'
filetypes:
- name: dosini
linguist: INI
extra_filenames:
- .editorconfig
- .npmrc
- '*/etc/pacman.conf'
- 'php.ini-*'
- '*/etc/yum.conf'
- '*/etc/yum.repos.d/*'
ignored_warnings:
- php.ini

View File

@@ -168,8 +168,33 @@ def copy_file(package, src, dest)
FileUtils.mkdir_p(File.dirname(dest))
name = package.fetch("name")
header = '" Polyglot metafile'
if File.exist?(dest)
meta_dest = dest
new_dest = dest
i = 0
while File.exist?(new_dest)
i += 1
new_dest = "#{dest.gsub(/\.vim$/, '')}-#{i}.vim"
end
if File.read(dest).include?(header)
dest = new_dest
else
FileUtils.mv(dest, new_dest)
File.write(meta_dest, "#{header}\n")
open(meta_dest, "a+") do |output|
output << "source <sfile>:h/#{File.basename(new_dest)}\n"
end
dest = "#{dest.gsub(/\.vim$/, '')}-#{i+1}.vim"
end
open(meta_dest, "a+") do |output|
output << "source <sfile>:h/#{File.basename(dest)}\n"
end
end
open(src, "r") do |input|
open(dest, "a+") do |output|
open(dest, "w") do |output|
if name == "jsx"
output << "if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)\n\n"
else
@@ -335,7 +360,8 @@ def extract(packages)
FileUtils.rm_rf(all_dirs)
output = []
packages.map do |package|
# We need to reverse packages so they are included in proper order
packages.reverse.map do |package|
repo, branch, path, dir = parse_remote(package["remote"])
dirs = package.fetch("dirs", default_dirs)
ignored_dirs = package.fetch("ignored_dirs", [])
@@ -406,21 +432,15 @@ def generate_ftdetect(packages, heuristics)
ambiguous_extensions = extensions
.select { |a, b| b.uniq.size > 1 }.keys.sort
expected_filetypes = detect_filetypes('tmp/**/ftdetect/*.vim')
all_filetypes = packages.flat_map { |f| f["filetypes"] || [] }
filetype_names = Set.new(all_filetypes.map { |f| f["name"] })
native_filetypes = detect_filetypes('tmp/vim/vim/runtime/filetype.vim')
native_extensions = native_filetypes.flat_map { |k, v| v["extensions"] }
expected_filetypes = detect_filetypes('tmp/**/ftdetect/*.vim') + native_filetypes
all_filetypes = Hash.new { |h, k| h[k] = { extensions: [], filenames: [] } }
expected_filetypes = expected_filetypes.select { |e| filetype_names.include?(e["name"]) }
for k, v in expected_filetypes
all_filetypes[k][:extensions].concat(v[:extensions])
all_filetypes[k][:filenames].concat(v[:filenames])
end
for k, v in native_filetypes
all_filetypes[k][:extensions].concat(v[:extensions])
all_filetypes[k][:filenames].concat(v[:filenames])
end
native_extensions = Set.new(native_filetypes.flat_map { |f| f["extensions"] || [] })
for package in packages
name = package.fetch("name")
@@ -429,7 +449,7 @@ def generate_ftdetect(packages, heuristics)
for filetype in package["filetypes"]
for extension in filetype["extensions"]
if native_filetypes.has_key?(extension)
if native_extensions.include?(extension)
to_disable << "*." + extension
end
end
@@ -465,20 +485,6 @@ def generate_ftdetect(packages, heuristics)
extensions = filetype["extensions"]
filenames = filetype["filenames"]
expected_extensions = (all_filetypes.has_key?(name) ? all_filetypes.fetch(name)[:extensions] : [])
ignored_extensions = expand_all(filetype.fetch("ignored_extensions", []))
ignored_warnings = expand_all(filetype.fetch("ignored_warnings", []))
if all_filetypes[name] && !filetype["syntax"]
for e in expected_extensions - extensions - ignored_extensions - ignored_warnings
puts "Probable missing extension for #{name}: #{e}"
end
for e in all_filetypes.fetch(name)[:filenames] - expand_all(filenames).flat_map { |e| [e, e.gsub(/^\./, '')] } - expand_all(filetype.fetch("ignored_warnings", [])) - ['*']
puts "Probable missing filename for #{name}: #{e}"
end
end
for extension in extensions.sort
outer_filetype = filetype["outer_filetype"]
if outer_filetype
@@ -522,6 +528,24 @@ def generate_ftdetect(packages, heuristics)
end
end
defined_extensions = all_filetypes.flat_map { |f| expand_all(f["extensions"] || []).map { |e| [f["name"], e] } }
expected_extensions = expected_filetypes.flat_map { |f| expand_all(f["extensions"] || []).map { |e| [f["name"], e] } }
ignored_extensions = all_filetypes.flat_map { |f| expand_all(f.fetch("ignored_extensions", [])).map { |e| [f["name"], e] } }
defined_filenames = all_filetypes.flat_map { |f| expand_all(f["filenames"] || []).map { |e| [f["name"], e] } }
expected_filenames = expected_filetypes.flat_map { |f| expand_all(f["filenames"] || []).map { |e| [f["name"], e] } }
ignored_filenames = all_filetypes.flat_map { |f| expand_all(f.fetch("ignored_filenames", [])).map { |e| [f["name"], e] } }
ignored_warnings = all_filetypes.flat_map { |f| expand_all(f.fetch("ignored_warnings", [])).map { |e| [f["name"], e] } + [f, "*"] }
for name, e in expected_extensions - defined_extensions - ignored_extensions - ignored_warnings
puts "Missing extension for #{name}: #{e}"
end
for name, e in expected_filenames - defined_filenames - ignored_filenames - ignored_warnings
puts "Missing filename for #{name}: #{e}"
end
ftdetect = File.read('ftdetect/polyglot.vim')
File.write('ftdetect/polyglot.vim', ftdetect.gsub(/(?<=" filetypes\n).*(?=\n" end filetypes)/m, output))
@@ -535,8 +559,10 @@ def generate_ftdetect(packages, heuristics)
let l:filetype = polyglot#Shebang()
if l:filetype != ""
exec "setf " . l:filetype
return
return 1
endif
return 0
endfunc
let s:interpreters = {
@@ -701,14 +727,15 @@ def detect_filetypes(glob)
results
end
Hash[filetypes.flat_map do |ext, filetype|
filetypes.flat_map do |ext, filetype|
expand_all(ext).map { |e| [filetype, e] }
end.group_by { |a, b| a }.map { |a, b| [a, b.map { |c, d| d }] }.map { |a, b|
[a, {
extensions: b.select { |x| x.match(/^\*\.[^\/]+$/) }.map { |a| a.strip[2..] },
filenames: expand_all(b.select { |x| !x.match(/^\*\.[^\/]+$/) })
}]
}]
{
"name" => a,
"extensions" => b.select { |x| x.match(/^\*\.[^\/]+$/) }.map { |a| a.strip[2..] },
"filenames" => expand_all(b.select { |x| !x.match(/^\*\.[^\/]+$/) })
}
}
end
def generate_plugins(packages)

View File

@@ -109,6 +109,7 @@ call TestFiletype('idris')
call TestFiletype('idris2')
call TestFiletype('lidris2')
call TestFiletype('ion')
call TestFiletype('javascriptreact')
call TestFiletype('javascript')
call TestFiletype('flow')
call TestFiletype('Jenkinsfile')
@@ -118,7 +119,6 @@ call TestFiletype('json5')
call TestFiletype('json')
call TestFiletype('jsonnet')
call TestFiletype('jst')
call TestFiletype('javascriptreact')
call TestFiletype('julia')
call TestFiletype('kotlin')
call TestFiletype('ledger')
@@ -230,3 +230,4 @@ call TestFiletype('zig')
call TestFiletype('trasys')
call TestFiletype('basic')
call TestFiletype('vb')
call TestFiletype('dosini')

44
syntax/dosini.vim Normal file
View File

@@ -0,0 +1,44 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dosini') == -1
" Vim syntax file
" Language: Configuration File (ini file) for MSDOS/MS Windows
" Version: 2.2
" Original Author: Sean M. McKee <mckee@misslink.net>
" Previous Maintainer: Nima Talebi <nima@it.net.au>
" Current Maintainer: Hong Xu <hong@topbug.net>
" Homepage: http://www.vim.org/scripts/script.php?script_id=3747
" Repository: https://github.com/xuhdev/syntax-dosini.vim
" Last Change: 2018 Sep 11
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" shut case off
syn case ignore
syn match dosiniLabel "^.\{-}\ze\s*=" nextgroup=dosiniNumber,dosiniValue
syn match dosiniValue "=\zs.*"
syn match dosiniNumber "=\zs\s*\d\+\s*$"
syn match dosiniNumber "=\zs\s*\d*\.\d\+\s*$"
syn match dosiniNumber "=\zs\s*\d\+e[+-]\=\d\+\s*$"
syn region dosiniHeader start="^\s*\[" end="\]"
syn match dosiniComment "^[#;].*$"
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link dosiniNumber Number
hi def link dosiniHeader Special
hi def link dosiniComment Comment
hi def link dosiniLabel Type
hi def link dosiniValue String
let b:current_syntax = "dosini"
" vim: sts=2 sw=2 et
endif

View File

@@ -424,8 +424,8 @@ function! s:hi()
" :GoDebug commands
if go#config#HighlightDebug()
hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
hi def GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
hi def GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
endif
endfunction

94
syntax/html-1.vim Normal file
View File

@@ -0,0 +1,94 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
" 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 28 August 2010
" add complete new attributes
" add wai-aria attributes
" add microdata attributes
" add rdfa attributes
syn keyword htmlTagName contained script
" 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 mark meter menu nav output
syn keyword htmlTagName contained progress time ruby rt rp section source summary time track video wbr
" 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
" 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
" 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
" <command>, <details>, <time>
syn keyword htmlArg contained label icon open datetime pubdate
" Custom Data Attributes
" http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute
syn match htmlArg "\<\(data(\-[a-z]\+)\+\)=" contained
" Microdata
" http://dev.w3.org/html5/md/
syn keyword htmlArg contained item itemid itemscope itemtype itemprop
" RDFa
" http://www.w3.org/TR/rdfa-syntax/#a_xhtmlrdfa_dtd
syn keyword htmlArg contained about typeof property resource content datatype rel rev
" 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 match htmlArg contained "\<aria-\(atomic\|busy\|controls\|describedby\)\>"
syn match htmlArg contained "\<aria-\(disabled\|dropeffect\|flowto\|grabbed\)\>"
syn match htmlArg contained "\<aria-\(haspopup\|hidden\|invalid\|label\)\>"
syn match htmlArg contained "\<aria-\(labelledby\|live\|owns\|relevant\)\>"
" Widget Attributes
syn match htmlArg contained "\<aria-\(autocomplete\|checked\|disabled\|expanded\)\>"
syn match htmlArg contained "\<aria-\(haspopup\|hidden\|invalid\|label\)\>"
syn match htmlArg contained "\<aria-\(level\|multiline\|multiselectable\|orientation\)\>"
syn match htmlArg contained "\<aria-\(pressed\|readonly\|required\|selected\)\>"
syn match htmlArg contained "\<aria-\(sort\|valuemax\|valuemin\|valuenow\|valuetext\|\)\>"
" Live Region Attributes
syn match htmlArg contained "\<aria-\(atomic\|busy\|live\|relevant\|\)\>"
" Drag-and-Drop attributes
syn match htmlArg contained "\<aria-\(dropeffect\|grabbed\)\>"
" Relationship Attributes
syn match htmlArg contained "\<aria-\(activedescendant\|controls\|describedby\|flowto\|\)\>"
syn match htmlArg contained "\<aria-\(labelledby\|owns\|posinset\|setsize\|\)\>"
endif

196
syntax/html-2.vim Normal file
View File

@@ -0,0 +1,196 @@
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 <rcmachado@gmail.com>
" URL: http://rm.blog.br/vim/syntax/html.vim
" Modified: htdebeer <H.T.de.Beer@gmail.com>
" 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
" <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 playsinline
" <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 pattern
" <command>, <details>, <time>
syn keyword htmlArg contained label icon open datetime-local pubdate
" <script>
syn keyword htmlArg contained async
" <content>
syn keyword htmlArg contained select
" <iframe>
syn keyword htmlArg contained seamless srcdoc sandbox allowfullscreen allowusermedia allowpaymentrequest allowpresentation
" <picture>
syn keyword htmlArg contained srcset sizes
" <a>
syn keyword htmlArg contained download media
" <script>, <style>
syn keyword htmlArg contained nonce
" <area>, <a>, <img>, <iframe>, <link>
syn keyword htmlArg contained referrerpolicy
" https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute
syn keyword htmlArg contained integrity crossorigin
" <link>
syn keyword htmlArg contained prefetch
" syn keyword htmlArg contained preload
" <img>
syn keyword htmlArg contained decoding
" https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers
syn keyword htmlArg contained onselectstart onselectionchange
" https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading
syn keyword htmlArg contained loading
" Custom Data Attributes
" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
syn match htmlArg "\<data[-.0-9_a-z]*-[-.0-9_a-z]*\>" contained
" Vendor Extension Attributes
" http://w3c.github.io/html/single-page.html#conformance-requirements-extensibility
syn match htmlArg "\<x[-.0-9_a-z]*-[-.0-9_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-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 onabort onactivate onbegin onclick onend onerror onfocusin onfocusout 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
syn keyword htmlArg contained u1 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: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
" MathML attributes
" https://www.w3.org/TR/MathML3/chapter2.html#interf.toplevel.atts
syn keyword htmlArg contained accent accentunder actiontype align alignmentscope altimg altimg-height altimg-valign altimg-width alttext
syn keyword htmlArg contained annotation-xml background base baseline bevelled cd cdgroup charalign charspacing close
syn keyword htmlArg contained closure color columnalign columnalignment columnlines columnspacing columnspan columnwidth crossout decimalpoint
syn keyword htmlArg contained definitionURL denomalign depth display displaystyle edge encoding equalcolumns equalrows fence
syn keyword htmlArg contained fontfamily fontsize fontstyle fontweight form frame framespacing groupalign height indentalign
syn keyword htmlArg contained indentalignfirst indentalignlast indentshift indentshiftfirst indentshiftlast indenttarget index infixlinebreakstyle integer largeop
syn keyword htmlArg contained leftoverhang length linebreak linebreakmultchar linebreakstyle lineleading linethickness location longdivstyle lquote
syn keyword htmlArg contained lspace ltr macros math mathbackground mathcolor mathsize mathvariant maxsize maxwidth
syn keyword htmlArg contained mediummathspace menclose minlabelspacing minsize mode movablelimits msgroup mslinethickness name nargs
syn keyword htmlArg contained newline notation numalign number occurrence open order other overflow position
syn keyword htmlArg contained rightoverhang role rowalign rowlines rowspacing rowspan rquote rspace schemaLocation scope
syn keyword htmlArg contained scriptlevel scriptminsize scriptsize scriptsizemultiplier selection separator separators shift side stackalign
syn keyword htmlArg contained stretchy subscriptshift superscriptshift symmetric thickmathspace thinmathspace type valign verythickmathspace verythinmathspace
syn keyword htmlArg contained veryverythickmathspace veryverythinmathspace voffset width xref
endif

View File

@@ -1,290 +1,3 @@
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 <rcmachado@gmail.com>
" URL: http://rm.blog.br/vim/syntax/html.vim
" Modified: htdebeer <H.T.de.Beer@gmail.com>
" 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
" <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 playsinline
" <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 pattern
" <command>, <details>, <time>
syn keyword htmlArg contained label icon open datetime-local pubdate
" <script>
syn keyword htmlArg contained async
" <content>
syn keyword htmlArg contained select
" <iframe>
syn keyword htmlArg contained seamless srcdoc sandbox allowfullscreen allowusermedia allowpaymentrequest allowpresentation
" <picture>
syn keyword htmlArg contained srcset sizes
" <a>
syn keyword htmlArg contained download media
" <script>, <style>
syn keyword htmlArg contained nonce
" <area>, <a>, <img>, <iframe>, <link>
syn keyword htmlArg contained referrerpolicy
" https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute
syn keyword htmlArg contained integrity crossorigin
" <link>
syn keyword htmlArg contained prefetch
" syn keyword htmlArg contained preload
" <img>
syn keyword htmlArg contained decoding
" https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers
syn keyword htmlArg contained onselectstart onselectionchange
" https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading
syn keyword htmlArg contained loading
" Custom Data Attributes
" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
syn match htmlArg "\<data[-.0-9_a-z]*-[-.0-9_a-z]*\>" contained
" Vendor Extension Attributes
" http://w3c.github.io/html/single-page.html#conformance-requirements-extensibility
syn match htmlArg "\<x[-.0-9_a-z]*-[-.0-9_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-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 onabort onactivate onbegin onclick onend onerror onfocusin onfocusout 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
syn keyword htmlArg contained u1 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: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
" MathML attributes
" https://www.w3.org/TR/MathML3/chapter2.html#interf.toplevel.atts
syn keyword htmlArg contained accent accentunder actiontype align alignmentscope altimg altimg-height altimg-valign altimg-width alttext
syn keyword htmlArg contained annotation-xml background base baseline bevelled cd cdgroup charalign charspacing close
syn keyword htmlArg contained closure color columnalign columnalignment columnlines columnspacing columnspan columnwidth crossout decimalpoint
syn keyword htmlArg contained definitionURL denomalign depth display displaystyle edge encoding equalcolumns equalrows fence
syn keyword htmlArg contained fontfamily fontsize fontstyle fontweight form frame framespacing groupalign height indentalign
syn keyword htmlArg contained indentalignfirst indentalignlast indentshift indentshiftfirst indentshiftlast indenttarget index infixlinebreakstyle integer largeop
syn keyword htmlArg contained leftoverhang length linebreak linebreakmultchar linebreakstyle lineleading linethickness location longdivstyle lquote
syn keyword htmlArg contained lspace ltr macros math mathbackground mathcolor mathsize mathvariant maxsize maxwidth
syn keyword htmlArg contained mediummathspace menclose minlabelspacing minsize mode movablelimits msgroup mslinethickness name nargs
syn keyword htmlArg contained newline notation numalign number occurrence open order other overflow position
syn keyword htmlArg contained rightoverhang role rowalign rowlines rowspacing rowspan rquote rspace schemaLocation scope
syn keyword htmlArg contained scriptlevel scriptminsize scriptsize scriptsizemultiplier selection separator separators shift side stackalign
syn keyword htmlArg contained stretchy subscriptshift superscriptshift symmetric thickmathspace thinmathspace type valign verythickmathspace verythinmathspace
syn keyword htmlArg contained veryverythickmathspace veryverythinmathspace voffset width xref
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
" 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 28 August 2010
" add complete new attributes
" add wai-aria attributes
" add microdata attributes
" add rdfa attributes
syn keyword htmlTagName contained script
" 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 mark meter menu nav output
syn keyword htmlTagName contained progress time ruby rt rp section source summary time track video wbr
" 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
" 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
" 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
" <command>, <details>, <time>
syn keyword htmlArg contained label icon open datetime pubdate
" Custom Data Attributes
" http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute
syn match htmlArg "\<\(data(\-[a-z]\+)\+\)=" contained
" Microdata
" http://dev.w3.org/html5/md/
syn keyword htmlArg contained item itemid itemscope itemtype itemprop
" RDFa
" http://www.w3.org/TR/rdfa-syntax/#a_xhtmlrdfa_dtd
syn keyword htmlArg contained about typeof property resource content datatype rel rev
" 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 match htmlArg contained "\<aria-\(atomic\|busy\|controls\|describedby\)\>"
syn match htmlArg contained "\<aria-\(disabled\|dropeffect\|flowto\|grabbed\)\>"
syn match htmlArg contained "\<aria-\(haspopup\|hidden\|invalid\|label\)\>"
syn match htmlArg contained "\<aria-\(labelledby\|live\|owns\|relevant\)\>"
" Widget Attributes
syn match htmlArg contained "\<aria-\(autocomplete\|checked\|disabled\|expanded\)\>"
syn match htmlArg contained "\<aria-\(haspopup\|hidden\|invalid\|label\)\>"
syn match htmlArg contained "\<aria-\(level\|multiline\|multiselectable\|orientation\)\>"
syn match htmlArg contained "\<aria-\(pressed\|readonly\|required\|selected\)\>"
syn match htmlArg contained "\<aria-\(sort\|valuemax\|valuemin\|valuenow\|valuetext\|\)\>"
" Live Region Attributes
syn match htmlArg contained "\<aria-\(atomic\|busy\|live\|relevant\|\)\>"
" Drag-and-Drop attributes
syn match htmlArg contained "\<aria-\(dropeffect\|grabbed\)\>"
" Relationship Attributes
syn match htmlArg contained "\<aria-\(activedescendant\|controls\|describedby\|flowto\|\)\>"
syn match htmlArg contained "\<aria-\(labelledby\|owns\|posinset\|setsize\|\)\>"
endif
" Polyglot metafile
source <sfile>:h/html-1.vim
source <sfile>:h/html-2.vim