Compare commits

...

27 Commits

Author SHA1 Message Date
Adam Stankiewicz
271679272c Fix eruby filetype detect, closes #547 2020-09-15 11:19:56 +02:00
Adam Stankiewicz
d43d269bed Update 2020-09-15 10:45:50 +02:00
Adam Stankiewicz
4314841aa4 Fix build, closes #548 2020-09-13 09:14:21 +02:00
Adam Stankiewicz
5308fab3e9 Fix build, closes #548 2020-09-13 09:13:11 +02:00
Adam Stankiewicz
c842cbcb59 Update 2020-09-12 14:54:55 +02:00
Adam Stankiewicz
314621a395 Make warning more clear, #546 2020-09-11 13:56:24 +02:00
Adam Stankiewicz
ca8818e8ed Improve issue template 2020-09-10 16:46:31 +02:00
Adam Stankiewicz
947e6853aa Improve issue template 2020-09-10 16:44:51 +02:00
Adam Stankiewicz
05ff14bfda Add odin support, closes #544 2020-09-10 16:38:32 +02:00
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
Adam Stankiewicz
19a69cf77d Remove debugging code... 2020-09-09 19:22:27 +02:00
Adam Stankiewicz
4f7a4036eb Finally fix issues with tab detection, #541 2020-09-09 19:08:17 +02:00
Adam Stankiewicz
0ff5d451b0 Fix b:sleuth_culprit for tabs 2020-09-09 18:31:30 +02:00
Adam Stankiewicz
49840b1893 Show full path in b:sleuth_culprit 2020-09-09 18:28:28 +02:00
Adam Stankiewicz
2dc954d6fa Last fixes to b:sleuth_culprit 2020-09-09 18:07:03 +02:00
Adam Stankiewicz
2369cd5d22 Make b:sleuth_culprit more readable 2020-09-09 18:02:38 +02:00
Adam Stankiewicz
46affb6153 Show warning if g:polyglot_disabled is not at the top of .vimrc 2020-09-09 17:50:40 +02:00
Adam Stankiewicz
a4cc3f64f9 Make it easier to debug indentation issues, #542 2020-09-09 17:39:27 +02:00
Adam Stankiewicz
2fe310256e Transcompile ..= operator to support old vims, fixes #542 2020-09-09 17:08:29 +02:00
Adam Stankiewicz
2e1a980632 Add missing functions from Sleuth, #541 2020-09-09 16:48:49 +02:00
Adam Stankiewicz
cecfb5dd10 Fix disabling autoindent, #541 2020-09-09 16:45:51 +02:00
Adam Stankiewicz
a4a9481d37 Fix disabling autoindent, closes #541 2020-09-09 11:58:24 +02:00
Adam Stankiewicz
5e5d127eb8 Add expect (fix tests) 2020-09-08 22:41:51 +02:00
Adam Stankiewicz
002573265a Fix some ftdetect issues from tests 2020-09-08 21:17:24 +02:00
48 changed files with 2811 additions and 1773 deletions

View File

@@ -2,17 +2,23 @@
name: Add language
about: Add support for new language
title: ''
labels: ''
labels: 'enhancement'
assignees: ''
---
<!--- vim-polyglot accepts only lightweight, maintained github-hosted vim plugins -->
**What is the name of this language in Linguist?**
<!-- https://github.com/github/linguist/blob/master/lib/linguist/languages.yml -->
**Link to GitHub repository of Vim plugin**
**GitHub repository url**
**Is this plugin well maintained?**
**Is this plugin lightweight? (no advanced functionality, just indent and syntax support)**

View File

@@ -1,20 +0,0 @@
---
name: Add support for language
about: ''
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -14,7 +14,7 @@ jobs:
run: |
sudo add-apt-repository ppa:jonathonf/vim -y
sudo apt-get update -q
sudo apt-get install -y vim
sudo apt-get install -y vim expect
vim --version
- uses: actions/checkout@v2
- name: Run Tests

View File

@@ -7,14 +7,14 @@ 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-->193<!--/Package Count--> packages it consists of.
- It **installs and updates 120+ times faster** than the <!--Package Count-->196<!--/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).
- Automatically detect indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth))
- Each build is tested by automated vimrunner script on CI. See `spec` directory.
\*To be completely honest, optimized `ftdetect` script takes around `19ms` to load.
\*To be completely honest, optimized `ftdetect` script takes around `20ms` to load.
## Installation
@@ -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)
@@ -118,6 +119,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [go](https://github.com/fatih/vim-go)
- [gradle](https://github.com/tfnico/vim-gradle)
- [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)
@@ -167,6 +169,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [objc](https://github.com/b4winckler/vim-objc)
- [ocaml](https://github.com/rgrinberg/vim-ocaml)
- [octave](https://github.com/McSinyx/vim-octave)
- [odin](https://github.com/Tetralux/odin.vim)
- [opencl](https://github.com/petRUShka/vim-opencl)
- [perl](https://github.com/vim-perl/vim-perl)
- [pgsql](https://github.com/lifepillar/pgsql.vim)

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

@@ -2,13 +2,23 @@
let s:cpo_save = &cpo
set cpo&vim
" We need it because scripts.vim in vim uses "set ft=" which cannot be
" overridden with setf (and we can't use set ft= so our scripts.vim work)
func! s:Setf(ft)
if &filetype !~# '<'.a:ft.'>'
let &filetype = a:ft
endif
endfunc
func! polyglot#Heuristics()
" Try to detect filetype from shebang
let l:filetype = polyglot#Shebang()
if l:filetype != ""
exec "setf " . l:filetype
return
return 1
endif
return 0
endfunc
let s:interpreters = {
@@ -21,6 +31,7 @@ let s:interpreters = {
\ 'escript': 'erlang',
\ 'fish': 'fish',
\ 'gnuplot': 'gnuplot',
\ 'groovy': 'groovy',
\ 'runhaskell': 'haskell',
\ 'chakra': 'javascript',
\ 'd8': 'javascript',
@@ -124,34 +135,34 @@ endfunc
func! polyglot#DetectInpFiletype()
let line = getline(1)
if line =~# '^\*'
setf abaqus | return
call s:Setf('abaqus') | return
endif
for lnum in range(1, min([line("$"), 500]))
let line = getline(lnum)
if line =~? '^header surface data'
setf trasys | return
call s:Setf('trasys') | return
endif
endfor
endfunc
func! polyglot#DetectAsaFiletype()
if exists("g:filetype_asa")
exe "setf " . g:filetype_asa | return
call s:Setf(g:filetype_asa) | return
endif
setf aspvbs | return
call s:Setf('aspvbs') | return
endfunc
func! polyglot#DetectAspFiletype()
if exists("g:filetype_asp")
exe "setf " . g:filetype_asp | return
call s:Setf(g:filetype_asp) | return
endif
for lnum in range(1, min([line("$"), 3]))
let line = getline(lnum)
if line =~? 'perlscript'
setf aspperl | return
call s:Setf('aspperl') | return
endif
endfor
setf aspvbs | return
call s:Setf('aspvbs') | return
endfunc
func! polyglot#DetectHFiletype()
@@ -159,18 +170,18 @@ func! polyglot#DetectHFiletype()
let line = getline(lnum)
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
if exists("g:c_syntax_for_h")
setf objc | return
call s:Setf('objc') | return
endif
setf objcpp | return
call s:Setf('objcpp') | return
endif
endfor
if exists("g:c_syntax_for_h")
setf c | return
call s:Setf('c') | return
endif
if exists("g:ch_syntax_for_h")
setf ch | return
call s:Setf('ch') | return
endif
setf cpp | return
call s:Setf('cpp') | return
endfunc
func! polyglot#DetectMFiletype()
@@ -181,53 +192,53 @@ func! polyglot#DetectMFiletype()
let saw_comment = 1
endif
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
setf objc | return
call s:Setf('objc') | return
endif
if line =~# '^\s*%'
setf octave | return
call s:Setf('octave') | return
endif
if line =~# '^\s*(\*'
setf mma | return
call s:Setf('mma') | return
endif
if line =~? '^\s*\(\(type\|var\)\(\<\|\>\)\|--\)'
setf murphi | return
call s:Setf('murphi') | return
endif
endfor
if saw_comment
setf objc | return
call s:Setf('objc') | return
endif
if exists("g:filetype_m")
exe "setf " . g:filetype_m | return
call s:Setf(g:filetype_m) | return
endif
setf octave | return
call s:Setf('octave') | return
endfunc
func! polyglot#DetectFsFiletype()
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\(: \|new-device\)'
setf forth | return
call s:Setf('forth') | return
endif
if line =~# '^\s*\(#light\|import\|let\|module\|namespace\|open\|type\)'
setf fsharp | return
call s:Setf('fsharp') | return
endif
if line =~# '\s*\(#version\|precision\|uniform\|varying\|vec[234]\)'
setf glsl | return
call s:Setf('glsl') | return
endif
endfor
if exists("g:filetype_fs")
exe "setf " . g:filetype_fs | return
call s:Setf(g:filetype_fs) | return
endif
setf forth | return
call s:Setf('forth') | return
endfunc
func! polyglot#DetectReFiletype()
for lnum in range(1, min([line("$"), 50]))
let line = getline(lnum)
if line =~# '^\s*#\%(\%(if\|ifdef\|define\|pragma\)\s\+\w\|\s*include\s\+[<"]\|template\s*<\)'
setf cpp | return
call s:Setf('cpp') | return
endif
setf reason | return
call s:Setf('reason') | return
endfor
endfunc
@@ -235,54 +246,54 @@ func! polyglot#DetectIdrFiletype()
for lnum in range(1, min([line("$"), 5]))
let line = getline(lnum)
if line =~# '^\s*--.*[Ii]dris \=1'
setf idris | return
call s:Setf('idris') | return
endif
if line =~# '^\s*--.*[Ii]dris \=2'
setf idris2 | return
call s:Setf('idris2') | return
endif
endfor
for lnum in range(1, min([line("$"), 30]))
let line = getline(lnum)
if line =~# '^pkgs =.*'
setf idris | return
call s:Setf('idris') | return
endif
if line =~# '^depends =.*'
setf idris2 | return
call s:Setf('idris2') | return
endif
if line =~# '^%language \(TypeProviders\|ElabReflection\)'
setf idris | return
call s:Setf('idris') | return
endif
if line =~# '^%language PostfixProjections'
setf idris2 | return
call s:Setf('idris2') | return
endif
if line =~# '^%access .*'
setf idris | return
call s:Setf('idris') | return
endif
if exists("g:filetype_idr")
exe "setf " . g:filetype_idr | return
call s:Setf(g:filetype_idr) | return
endif
endfor
setf idris2 | return
call s:Setf('idris2') | return
endfunc
func! polyglot#DetectLidrFiletype()
for lnum in range(1, min([line("$"), 200]))
let line = getline(lnum)
if line =~# '^>\s*--.*[Ii]dris \=1'
setf lidris | return
call s:Setf('lidris') | return
endif
endfor
setf lidris2 | return
call s:Setf('lidris2') | return
endfunc
func! polyglot#DetectBasFiletype()
for lnum in range(1, min([line("$"), 5]))
let line = getline(lnum)
if line =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
setf vb | return
call s:Setf('vb') | return
endif
endfor
setf basic | return
call s:Setf('basic') | return
endfunc
" Restore 'cpoptions'

View File

@@ -44,7 +44,7 @@ let s:globs = {
\ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot',
\ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt',
\ 'coffee': '*.coffee,*._coffee,*.cake,*.cjsx,*.iced,*.coffeekup,Cakefile',
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc',
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh',
\ 'cql': '*.cql',
\ 'cryptol': '*.cry,*.cyl,*.lcry,*.lcyl',
\ 'crystal': '*.cr,Projectfile',
@@ -57,7 +57,7 @@ let s:globs = {
\ 'dd': '*.dd',
\ 'ddoc': '*.ddoc',
\ 'dhall': '*.dhall',
\ 'dosini': '*.wrap',
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,php.ini-*',
\ 'dsdl': '*.sdl',
\ 'dune': 'jbuild,dune,dune-project,dune-workspace',
\ 'ecrystal': '*.ecr',
@@ -78,18 +78,18 @@ let s:globs = {
\ 'forth': '*.fs,*.ft,*.fth',
\ 'fsharp': '*.fs,*.fsi,*.fsx',
\ 'gdscript3': '*.gd',
\ 'gitcommit': '',
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
\ 'gitconfig': '*.gitconfig',
\ 'gitrebase': 'git-rebase-todo',
\ 'gitsendemail': '',
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp',
\ 'gmpl': '*.mod',
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt',
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
\ 'go': '*.go',
\ 'gohtmltmpl': '*.tmpl',
\ 'gomod': 'go.mod',
\ 'graphql': '*.graphql,*.gql,*.graphqls',
\ 'groovy': '*.gradle',
\ 'groovy': '*.groovy,*.grt,*.gtpl,*.gvy,*.gradle,Jenkinsfile',
\ 'grub': '',
\ 'haml': '*.haml,*.haml.deface,*.hamlc,*.hamlbars',
\ 'haproxy': '*.cfg,haproxy.cfg,haproxy*.c*',
@@ -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',
@@ -144,6 +144,7 @@ let s:globs = {
\ 'ocpbuild': '*.ocp',
\ 'ocpbuildroot': '*.root',
\ 'octave': '*.oct,*.m',
\ 'odin': '*.odin',
\ 'omake': '*.om,OMakefile,OMakeroot,OMakeroot.in',
\ 'opam': '*.opam,*.opam.template,opam',
\ 'opencl': '*.cl,*.opencl',

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*

File diff suppressed because it is too large Load Diff

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

23
ftplugin/groovy.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'groovy') == -1
" Vim filetype plugin file
" Language: groovy
" Maintainer: Justin M. Keyes <justinkz@gmail.com>
" Last Change: 2016 May 22
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo-=C
let b:undo_ftplugin = 'setlocal commentstring<'
setlocal commentstring=//%s
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -19,7 +19,7 @@ setlocal comments=:# commentstring=#\ %s expandtab
setlocal formatoptions-=t formatoptions+=croql
if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0
let b:undo_ftplugin ..= " sw< sts<"
let b:undo_ftplugin .= " sw< sts<"
setlocal shiftwidth=2 softtabstop=2
endif

View File

@@ -26,6 +26,16 @@ if has("comments")
setlocal commentstring=//\ %s
endif
if has('find_in_path')
let &l:includeexpr='substitute(v:fname, "^([^.])$", "\1.zig", "")'
let &l:include='\v(\@import>|\@cInclude>|^\s*\#\s*include)'
let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)'
endif
if has('eval')
execute 'setlocal path+=' . json_decode(system('zig env'))['std_dir']
endif
let b:undo_ftplugin = "setl et< ts< sts< sw< fo< sua< mp< com< cms<"
let &cpo = s:cpo_orig

View File

@@ -6,7 +6,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
" Last Update: 2017-Feb-28
" Last Update: 2020-Jun-11
" License: Vim license
" URL: https://github.com/vim-erlang/vim-erlang-runtime

View File

@@ -45,6 +45,10 @@ endif
let s:cpo_save = &cpoptions
set cpoptions&vim
" searchpair() skip expression that matches in comments and strings.
let s:pair_skip_expr =
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "comment\\|string"'
" Check if the character at lnum:col is inside a string.
function s:InString(lnum, col)
return synIDattr(synID(a:lnum, a:col, 1), 'name') ==# 'graphqlString'
@@ -61,18 +65,18 @@ function GetGraphQLIndent()
let l:line = getline(v:lnum)
" If this line contains just a closing bracket, find its matching opening
" bracket and indent the closing backet to match.
" bracket and indent the closing bracket to match.
let l:col = matchend(l:line, '^\s*[]})]')
if l:col > 0 && !s:InString(v:lnum, l:col)
let l:bracket = l:line[l:col - 1]
call cursor(v:lnum, l:col)
if l:bracket is# '}'
let l:matched = searchpair('{', '', '}', 'bW')
elseif l:bracket is# ']'
let l:matched = searchpair('\[', '', '\]', 'bW')
elseif l:bracket is# ')'
let l:matched = searchpair('(', '', ')', 'bW')
let l:bracket = l:line[l:col - 1]
if l:bracket ==# '}'
let l:matched = searchpair('{', '', '}', 'bW', s:pair_skip_expr)
elseif l:bracket ==# ']'
let l:matched = searchpair('\[', '', '\]', 'bW', s:pair_skip_expr)
elseif l:bracket ==# ')'
let l:matched = searchpair('(', '', ')', 'bW', s:pair_skip_expr)
else
let l:matched = -1
endif
@@ -85,9 +89,8 @@ function GetGraphQLIndent()
return indent(v:lnum)
endif
" If the previous line contained an opening bracket, and we are still in it,
" add indent depending on the bracket type.
if getline(l:prevlnum) =~# '[[{(]\s*$'
" If the previous line ended with an opening bracket, indent this line.
if getline(l:prevlnum) =~# '\%(#.*\)\@<![[{(]\s*$'
return indent(l:prevlnum) + shiftwidth()
endif

41
indent/odin.vim Normal file
View File

@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'odin') == -1
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal nosmartindent
setlocal nolisp
setlocal autoindent
setlocal indentexpr=GetOdinIndent(v:lnum)
if exists("*GetOdinIndent")
finish
endif
function! GetOdinIndent(lnum)
let prev = prevnonblank(a:lnum-1)
if prev == 0
return 0
endif
let prevline = getline(prev)
let line = getline(a:lnum)
let ind = indent(prev)
if prevline =~ '[({]\s*$'
let ind += &sw
endif
if line =~ '^\s*[)}]'
let ind -= &sw
endif
return ind
endfunction
endif

View File

@@ -318,16 +318,25 @@ filetypes:
linguist: C++
extra_extensions:
- moc
# TLH files are C++ headers generated by Visual C++'s #import from typelibs
- tlh
ignored_extensions:
# conflicts with more popular reason, remove after heuristics work
- re
# implemented by arduino
- ino
ignored_warnings:
# TODO: fix these
- C
- H
- name: c
linguist: C
extra_extensions:
# Quake C
- qc
extra_filenames:
# Enlightenment configuration file
- '*enlightenment/*.cfg'
---
name: caddyfile
remote: isobit/vim-caddyfile
@@ -601,16 +610,27 @@ filetypes:
extra_filenames:
- "*.git/config"
- "*/.config/git/config"
- "*.git/modules/*/config"
- "*/git/config"
- "*/{.,}gitconfig.d/*"
ignored_warnings:
- '/etc/gitconfig'
- '$XDG_CONFIG_HOME/git/config'
- "*.git/modules/**/config"
- '.gitmodules'
- "*.git/modules/**/config"
- "/etc/gitconfig.d/*"
- name: gitrebase
filenames:
- git-rebase-todo
- name: gitsendemail
filenames:
- ".gitsendemail.*"
ignored_warnings:
- '.gitsendemail.msg.??????'
- name: gitcommit
filenames:
- 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG'
ignored_warnings:
- '*.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG'
---
name: glsl
@@ -636,6 +656,9 @@ remote: vim-scripts/gnuplot-syntax-highlighting
filetypes:
- name: gnuplot
linguist: Gnuplot
extra_extensions:
# Gnuplot scripts
- gpi
---
name: go
remote: fatih/vim-go
@@ -656,15 +679,29 @@ 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
---
name: gradle
remote: tfnico/vim-gradle
after: groovy
# Just adds compiler
filetypes: []
---
name: groovy
remote: vim/vim:runtime
glob: '**/groovy.vim'
filetypes:
- name: groovy
linguist: Gradle
linguist: Groovy
extra_extensions:
- gradle
---
name: grub
remote: vim/vim:runtime
@@ -851,7 +888,6 @@ filetypes:
linguist: JSONiq
extra_filenames:
- ".jqrc"
ignored_filenames:
- ".jqrc*"
---
name: json5
@@ -868,6 +904,8 @@ filetypes:
extra_extensions:
- jsonp
- template
extra_filenames:
- Pipfile.lock
---
name: jsonnet
remote: google/vim-jsonnet
@@ -890,6 +928,7 @@ filetypes:
---
name: jsx
remote: MaxMEllon/vim-jsx-pretty
after: javascript
filetypes:
- name: javascriptreact
linguist: JSX
@@ -988,6 +1027,7 @@ filetypes:
linguist: Mathematica
extra_extensions:
- wls
- mma
---
name: markdown
remote: plasticboy/vim-markdown
@@ -1157,7 +1197,6 @@ remote: StanAngeloff/php.vim
filetypes:
- name: php
linguist: PHP
# Needs to be after .php (can be .blade.php)
---
name: blade
remote: jwalton512/vim-blade
@@ -1771,3 +1810,27 @@ 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_extensions:
- cfg
ignored_warnings:
- php.ini
---
name: odin
remote: Tetralux/odin.vim
filetypes:
- name: odin
linguist: Odin

3
scripts/Gemfile Normal file
View File

@@ -0,0 +1,3 @@
source "https://rubygems.org"
gem "jasherai-oniguruma"

View File

@@ -29,15 +29,8 @@ def load_data()
deps = Hash.new { |h, k| h[k] = [] }
for package in packages.values
for name in [package.fetch("after", [])].flatten
packages[name] or raise "#{package["name"]} depends on unknown package: #{name}"
deps[name] << package["name"]
end
end
each_node = lambda {|&b| packages.keys.each(&b) }
each_child = lambda {|n, &b| deps[n].each(&b) }
each_child = lambda {|n, &b| [packages[n].fetch("after", [])].flatten.each(&b) }
languages = load_languages
@@ -97,25 +90,6 @@ def load_data()
[packages, transform_patterns(heuristics)]
end
def parallel(*procs)
threads = procs.map { |p| Thread.new { method(p).call } }
threads.map(&:join).map(&:value)
end
def read_strings(data, keys, print=false)
if data.is_a?(Hash)
data.flat_map do |key, val|
read_strings(val, keys, keys.include?(key))
end
elsif data.is_a?(Array)
data.flat_map { |d| read_strings(d, keys, print) }
elsif data.is_a?(String)
print ? [data] : []
else
[]
end
end
def patterns_to_vim_patterns(patterns)
stdin, stdout, stderr = Open3.popen3('vim', '-V', '--clean', '/dev/stdin', '-es', '-c', "echo expand('%:p:h') | source #{__dir__}/eregex.vim", '-c', "for line in range(0, line('$')) | call setline(line, ExtendedRegex2VimRegex(getline(line))) | endfor", '-c', ':wq! /dev/stdout', chdir: __dir__)
stdin.write(patterns.join("\n"))
@@ -154,8 +128,15 @@ def transform_patterns(heuristics)
end
def load_languages
url = "#{BASE_URL}/lib/linguist/languages.yml"
data = URI.open(url) { |io| YAML.load(io.read) }
file = 'tmp/languages.yml'
unless File.exist?(file)
url = "#{BASE_URL}/lib/linguist/languages.yml"
data = URI.open(url) { |io| io.read }
File.write(file, data)
end
YAML.load(File.read(file))
end
def parse_remote(remote)
@@ -168,14 +149,43 @@ def copy_file(package, src, dest)
FileUtils.mkdir_p(File.dirname(dest))
name = package.fetch("name")
if dest.end_with?(".vim")
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
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
output << "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '#{name}') == -1\n\n"
end
IO.copy_stream(input, output)
contents = File.read(input)
contents.gsub!(' ..= ', ' .= ')
output << contents
output << "\nendif\n"
end
end
@@ -310,13 +320,13 @@ def rule_to_code(rule)
if rule.has_key?("override")
return <<~EOS
if exists("#{rule["override"]}")
exe "setf " . #{rule["override"]} | return
call s:Setf(#{rule["override"]}) | return
endif
EOS
end
if rule.has_key?("filetype")
return "setf #{rule["filetype"]} | return"
return "call s:Setf('#{rule["filetype"]}') | return"
end
return ""
@@ -404,21 +414,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")
@@ -427,7 +431,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
@@ -450,7 +454,7 @@ def generate_ftdetect(packages, heuristics)
name = filetype.fetch("name")
syntax = filetype["syntax"] ? " | set syntax=#{filetype["syntax"]}" : ""
set_command = "setf #{name}"
set_command = "call s:Setf('#{name}')"
if filetype["syntax"]
set_command = "if !did_filetype() | set ft=#{name} syntax=#{filetype["syntax"]} | endif"
@@ -463,20 +467,6 @@ def generate_ftdetect(packages, heuristics)
extensions = filetype["extensions"]
filenames = filetype["filenames"]
expected_extensions = (all_filetypes.has_key?(name) ? all_filetypes.fetch(name)[:extensions] : []).map(&:downcase)
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
@@ -520,6 +510,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))
@@ -528,13 +536,23 @@ def generate_ftdetect(packages, heuristics)
let s:cpo_save = &cpo
set cpo&vim
" We need it because scripts.vim in vim uses "set ft=" which cannot be
" overridden with setf (and we can't use set ft= so our scripts.vim work)
func! s:Setf(ft)
if &filetype !~# '\<'.a:ft.'\>'
let &filetype = a:ft
endif
endfunc
func! polyglot#Heuristics()
" Try to detect filetype from shebang
let l:filetype = polyglot#Shebang()
if l:filetype != ""
exec "setf " . l:filetype
return
return 1
endif
return 0
endfunc
let s:interpreters = {
@@ -699,14 +717,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)
@@ -747,6 +766,8 @@ if __FILE__ == $0
FileUtils.rm_rf("tmp")
end
Dir.mkdir('tmp') unless File.exists?('tmp')
packages, heuristics = load_data()
download(packages)
extract(packages)

View File

@@ -6,7 +6,7 @@ vim --clean -N -u <(echo "
let &rtp='$PWD,'.&rtp
let g:polyglot_test = 1
source scripts/test_extensions.vim
\"source scripts/test_filetypes.vim
source scripts/test_filetypes.vim
qa!
")

View File

@@ -11,6 +11,7 @@ function! TestFiletype(filetype)
endfunction
call TestFiletype('8th')
call TestFiletype('haproxy')
call TestFiletype('a2ps')
call TestFiletype('a65')
call TestFiletype('aap')
@@ -26,16 +27,20 @@ call TestFiletype('aidl')
call TestFiletype('alsaconf')
call TestFiletype('aml')
call TestFiletype('ampl')
call TestFiletype('xml')
call TestFiletype('ant')
call TestFiletype('apache')
call TestFiletype('apiblueprint')
call TestFiletype('applescript')
call TestFiletype('aptconf')
call TestFiletype('arch')
call TestFiletype('cpp')
call TestFiletype('c')
call TestFiletype('arduino')
call TestFiletype('art')
call TestFiletype('asciidoc')
call TestFiletype('autohotkey')
call TestFiletype('elf')
call TestFiletype('automake')
call TestFiletype('asn')
call TestFiletype('aspvbs')
@@ -44,9 +49,6 @@ call TestFiletype('atlas')
call TestFiletype('autoit')
call TestFiletype('ave')
call TestFiletype('awk')
call TestFiletype('reason')
call TestFiletype('cpp')
call TestFiletype('c')
call TestFiletype('caddyfile')
call TestFiletype('carp')
call TestFiletype('clojure')
@@ -61,7 +63,6 @@ call TestFiletype('cucumber')
call TestFiletype('cuesheet')
call TestFiletype('dart')
call TestFiletype('dhall')
call TestFiletype('grub')
call TestFiletype('d')
call TestFiletype('dcov')
call TestFiletype('dd')
@@ -69,7 +70,6 @@ call TestFiletype('ddoc')
call TestFiletype('dsdl')
call TestFiletype('Dockerfile')
call TestFiletype('yaml.docker-compose')
call TestFiletype('elf')
call TestFiletype('elixir')
call TestFiletype('eelixir')
call TestFiletype('elm')
@@ -81,23 +81,26 @@ call TestFiletype('ferm')
call TestFiletype('fish')
call TestFiletype('fbs')
call TestFiletype('forth')
call TestFiletype('glsl')
call TestFiletype('fsharp')
call TestFiletype('gdscript3')
call TestFiletype('gitconfig')
call TestFiletype('gitrebase')
call TestFiletype('gitsendemail')
call TestFiletype('gitcommit')
call TestFiletype('glsl')
call TestFiletype('gmpl')
call TestFiletype('gnuplot')
call TestFiletype('go')
call TestFiletype('gomod')
call TestFiletype('gohtmltmpl')
call TestFiletype('javascript')
call TestFiletype('flow')
call TestFiletype('javascriptreact')
call TestFiletype('graphql')
call TestFiletype('groovy')
call TestFiletype('grub')
call TestFiletype('haml')
call TestFiletype('mustache')
call TestFiletype('haproxy')
call TestFiletype('haskell')
call TestFiletype('haxe')
call TestFiletype('hcl')
@@ -109,8 +112,6 @@ call TestFiletype('idris')
call TestFiletype('idris2')
call TestFiletype('lidris2')
call TestFiletype('ion')
call TestFiletype('javascript')
call TestFiletype('flow')
call TestFiletype('Jenkinsfile')
call TestFiletype('jinja.html')
call TestFiletype('jq')
@@ -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')
@@ -131,7 +131,6 @@ call TestFiletype('log')
call TestFiletype('lua')
call TestFiletype('m4')
call TestFiletype('mako')
call TestFiletype('octave')
call TestFiletype('mma')
call TestFiletype('markdown')
call TestFiletype('markdown.mdx')
@@ -152,12 +151,13 @@ call TestFiletype('ocamlbuild_tags')
call TestFiletype('ocpbuild')
call TestFiletype('ocpbuildroot')
call TestFiletype('sexplib')
call TestFiletype('octave')
call TestFiletype('opencl')
call TestFiletype('perl')
call TestFiletype('sql')
call TestFiletype('cql')
call TestFiletype('blade')
call TestFiletype('php')
call TestFiletype('blade')
call TestFiletype('plantuml')
call TestFiletype('pony')
call TestFiletype('ps1')
@@ -178,6 +178,7 @@ call TestFiletype('ragel')
call TestFiletype('raku')
call TestFiletype('raml')
call TestFiletype('razor')
call TestFiletype('reason')
call TestFiletype('rst')
call TestFiletype('ruby')
call TestFiletype('eruby')
@@ -218,10 +219,9 @@ call TestFiletype('velocity')
call TestFiletype('vmasm')
call TestFiletype('vue')
call TestFiletype('xdc')
call TestFiletype('xml')
call TestFiletype('xsl')
call TestFiletype('yaml.ansible')
call TestFiletype('yaml')
call TestFiletype('yaml.ansible')
call TestFiletype('helm')
call TestFiletype('help')
call TestFiletype('zephir')
@@ -230,3 +230,5 @@ call TestFiletype('zig')
call TestFiletype('trasys')
call TestFiletype('basic')
call TestFiletype('vb')
call TestFiletype('dosini')
call TestFiletype('odin')

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

@@ -20,7 +20,7 @@ syn keyword lispKey ppx_runtime_libraries virtual_deps js_of_ocaml link_flags
syn keyword lispKey javascript_files flags ocamlc_flags ocamlopt_flags pps staged_pps
syn keyword lispKey library_flags c_flags c_library_flags kind package action
syn keyword lispKey deps targets locks fallback
syn keyword lispKey inline_tests tests names
syn keyword lispKey inline_tests tests test names
syn keyword lispAtom true false

View File

@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
" Language: Erlang (http://www.erlang.org)
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
" Contributor: Adam Rutkowski <hq@mtod.org>
" Last Update: 2019-Jun-18
" Last Update: 2020-May-26
" License: Vim license
" URL: https://github.com/vim-erlang/vim-erlang-runtime

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

454
syntax/groovy.vim Normal file
View File

@@ -0,0 +1,454 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'groovy') == -1
" Vim syntax file
" Language: Groovy
" Original Author: Alessio Pace <billy.corgan AT tiscali.it>
" Maintainer: Tobias Rapp <yahuxo+vim AT mailbox.org>
" Version: 0.1.17
" URL: http://www.vim.org/scripts/script.php?script_id=945
" Last Change: 2020 May 26
" THE ORIGINAL AUTHOR'S NOTES:
"
" This is my very first vim script, I hope to have
" done it the right way.
"
" I must directly or indirectly thank the author of java.vim and ruby.vim:
" I copied from them most of the stuff :-)
"
" Relies on html.vim
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
"
" HOWTO USE IT (INSTALL) when not part of the distribution:
"
" 1) copy the file in the (global or user's $HOME/.vim/syntax/) syntax folder
"
" 2) add this line to recognize groovy files by filename extension:
"
" au BufNewFile,BufRead *.groovy setf groovy
" in the global vim filetype.vim file or inside $HOME/.vim/filetype.vim
"
" 3) add this part to recognize by content groovy script (no extension needed :-)
"
" if did_filetype()
" finish
" endif
" if getline(1) =~ '^#!.*[/\\]groovy\>'
" setf groovy
" endif
"
" in the global scripts.vim file or in $HOME/.vim/scripts.vim
"
" 4) open/write a .groovy file or a groovy script :-)
"
" Let me know if you like it or send me patches, so that I can improve it
" when I have time
" quit when a syntax file was already loaded
if !exists("main_syntax")
if exists("b:current_syntax")
finish
endif
" we define it here so that included files can test for it
let main_syntax='groovy'
endif
let s:cpo_save = &cpo
set cpo&vim
" ##########################
" Java stuff taken from java.vim
" some characters that cannot be in a groovy program (outside a string)
" syn match groovyError "[\\@`]"
"syn match groovyError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
"syn match groovyOK "\.\.\."
" keyword definitions
syn keyword groovyExternal native package
syn match groovyExternal "\<import\>\(\s\+static\>\)\?"
syn keyword groovyError goto const
syn keyword groovyConditional if else switch
syn keyword groovyRepeat while for do
syn keyword groovyBoolean true false
syn keyword groovyConstant null
syn keyword groovyTypedef this super
syn keyword groovyOperator new instanceof
syn keyword groovyType boolean char byte short int long float double
syn keyword groovyType void
syn keyword groovyType Integer Double Date Boolean Float String Array Vector List
syn keyword groovyStatement return
syn keyword groovyStorageClass static synchronized transient volatile final strictfp serializable
syn keyword groovyExceptions throw try catch finally
syn keyword groovyAssert assert
syn keyword groovyMethodDecl synchronized throws
syn keyword groovyClassDecl extends implements interface
" to differentiate the keyword class from MyClass.class we use a match here
syn match groovyTypedef "\.\s*\<class\>"ms=s+1
syn keyword groovyClassDecl enum
syn match groovyClassDecl "^class\>"
syn match groovyClassDecl "[^.]\s*\<class\>"ms=s+1
syn keyword groovyBranch break continue nextgroup=groovyUserLabelRef skipwhite
syn match groovyUserLabelRef "\k\+" contained
syn keyword groovyScopeDecl public protected private abstract
if exists("groovy_highlight_groovy_lang_ids") || exists("groovy_highlight_groovy_lang") || exists("groovy_highlight_all")
" groovy.lang.*
syn keyword groovyLangClass Closure MetaMethod GroovyObject
syn match groovyJavaLangClass "\<System\>"
syn keyword groovyJavaLangClass Cloneable Comparable Runnable Serializable Boolean Byte Class Object
syn keyword groovyJavaLangClass Character CharSequence ClassLoader Compiler
" syn keyword groovyJavaLangClass Integer Double Float Long
syn keyword groovyJavaLangClass InheritableThreadLocal Math Number Object Package Process
syn keyword groovyJavaLangClass Runtime RuntimePermission InheritableThreadLocal
syn keyword groovyJavaLangClass SecurityManager Short StrictMath StackTraceElement
syn keyword groovyJavaLangClass StringBuffer Thread ThreadGroup
syn keyword groovyJavaLangClass ThreadLocal Throwable Void ArithmeticException
syn keyword groovyJavaLangClass ArrayIndexOutOfBoundsException AssertionError
syn keyword groovyJavaLangClass ArrayStoreException ClassCastException
syn keyword groovyJavaLangClass ClassNotFoundException
syn keyword groovyJavaLangClass CloneNotSupportedException Exception
syn keyword groovyJavaLangClass IllegalAccessException
syn keyword groovyJavaLangClass IllegalArgumentException
syn keyword groovyJavaLangClass IllegalMonitorStateException
syn keyword groovyJavaLangClass IllegalStateException
syn keyword groovyJavaLangClass IllegalThreadStateException
syn keyword groovyJavaLangClass IndexOutOfBoundsException
syn keyword groovyJavaLangClass InstantiationException InterruptedException
syn keyword groovyJavaLangClass NegativeArraySizeException NoSuchFieldException
syn keyword groovyJavaLangClass NoSuchMethodException NullPointerException
syn keyword groovyJavaLangClass NumberFormatException RuntimeException
syn keyword groovyJavaLangClass SecurityException StringIndexOutOfBoundsException
syn keyword groovyJavaLangClass UnsupportedOperationException
syn keyword groovyJavaLangClass AbstractMethodError ClassCircularityError
syn keyword groovyJavaLangClass ClassFormatError Error ExceptionInInitializerError
syn keyword groovyJavaLangClass IllegalAccessError InstantiationError
syn keyword groovyJavaLangClass IncompatibleClassChangeError InternalError
syn keyword groovyJavaLangClass LinkageError NoClassDefFoundError
syn keyword groovyJavaLangClass NoSuchFieldError NoSuchMethodError
syn keyword groovyJavaLangClass OutOfMemoryError StackOverflowError
syn keyword groovyJavaLangClass ThreadDeath UnknownError UnsatisfiedLinkError
syn keyword groovyJavaLangClass UnsupportedClassVersionError VerifyError
syn keyword groovyJavaLangClass VirtualMachineError
syn keyword groovyJavaLangObject clone equals finalize getClass hashCode
syn keyword groovyJavaLangObject notify notifyAll toString wait
hi def link groovyLangClass groovyConstant
hi def link groovyJavaLangClass groovyExternal
hi def link groovyJavaLangObject groovyConstant
syn cluster groovyTop add=groovyJavaLangObject,groovyJavaLangClass,groovyLangClass
syn cluster groovyClasses add=groovyJavaLangClass,groovyLangClass
endif
" Groovy stuff
syn match groovyOperator "\.\."
syn match groovyOperator "<\{2,3}"
syn match groovyOperator ">\{2,3}"
syn match groovyOperator "->"
syn match groovyLineComment '^\%1l#!.*' " Shebang line
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
" Groovy JDK stuff
syn keyword groovyJDKBuiltin as def in
syn keyword groovyJDKOperOverl div minus plus abs round power multiply
syn keyword groovyJDKMethods each call inject sort print println
syn keyword groovyJDKMethods getAt putAt size push pop toList getText writeLine eachLine readLines
syn keyword groovyJDKMethods withReader withStream withWriter withPrintWriter write read leftShift
syn keyword groovyJDKMethods withWriterAppend readBytes splitEachLine
syn keyword groovyJDKMethods newInputStream newOutputStream newPrintWriter newReader newWriter
syn keyword groovyJDKMethods compareTo next previous isCase
syn keyword groovyJDKMethods times step toInteger upto any collect dump every find findAll grep
syn keyword groovyJDKMethods inspect invokeMethods join
syn keyword groovyJDKMethods getErr getIn getOut waitForOrKill
syn keyword groovyJDKMethods count tokenize asList flatten immutable intersect reverse reverseEach
syn keyword groovyJDKMethods subMap append asWritable eachByte eachLine eachFile
syn cluster groovyTop add=groovyJDKBuiltin,groovyJDKOperOverl,groovyJDKMethods
" no useful I think, so I comment it..
"if filereadable(expand("<sfile>:p:h")."/groovyid.vim")
" source <sfile>:p:h/groovyid.vim
"endif
if exists("groovy_space_errors")
if !exists("groovy_no_trail_space_error")
syn match groovySpaceError "\s\+$"
endif
if !exists("groovy_no_tab_space_error")
syn match groovySpaceError " \+\t"me=e-1
endif
endif
" it is a better case construct than java.vim to match groovy syntax
syn region groovyLabelRegion transparent matchgroup=groovyLabel start="\<case\>" matchgroup=NONE end=":\|$" contains=groovyNumber,groovyString,groovyLangClass,groovyJavaLangClass
syn match groovyUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=groovyLabel
syn keyword groovyLabel default
if !exists("groovy_allow_cpp_keywords")
syn keyword groovyError auto delete extern friend inline redeclared
syn keyword groovyError register signed sizeof struct template typedef union
syn keyword groovyError unsigned operator
endif
" The following cluster contains all groovy groups except the contained ones
syn cluster groovyTop add=groovyExternal,groovyError,groovyError,groovyBranch,groovyLabelRegion,groovyLabel,groovyConditional,groovyRepeat,groovyBoolean,groovyConstant,groovyTypedef,groovyOperator,groovyType,groovyType,groovyStatement,groovyStorageClass,groovyAssert,groovyExceptions,groovyMethodDecl,groovyClassDecl,groovyClassDecl,groovyClassDecl,groovyScopeDecl,groovyError,groovyError2,groovyUserLabel,groovyLangObject
" Comments
syn keyword groovyTodo contained TODO FIXME XXX
if exists("groovy_comment_strings")
syn region groovyCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=groovySpecial,groovyCommentStar,groovySpecialChar,@Spell
syn region groovyComment2String contained start=+"+ end=+$\|"+ contains=groovySpecial,groovySpecialChar,@Spell
syn match groovyCommentCharacter contained "'\\[^']\{1,6\}'" contains=groovySpecialChar
syn match groovyCommentCharacter contained "'\\''" contains=groovySpecialChar
syn match groovyCommentCharacter contained "'[^\\]'"
syn cluster groovyCommentSpecial add=groovyCommentString,groovyCommentCharacter,groovyNumber
syn cluster groovyCommentSpecial2 add=groovyComment2String,groovyCommentCharacter,groovyNumber
endif
syn region groovyComment start="/\*" end="\*/" contains=@groovyCommentSpecial,groovyTodo,@Spell
syn match groovyCommentStar contained "^\s*\*[^/]"me=e-1
syn match groovyCommentStar contained "^\s*\*$"
syn match groovyLineComment "//.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
hi def link groovyCommentString groovyString
hi def link groovyComment2String groovyString
hi def link groovyCommentCharacter groovyCharacter
syn cluster groovyTop add=groovyComment,groovyLineComment
if !exists("groovy_ignore_groovydoc") && main_syntax != 'jsp'
syntax case ignore
" syntax coloring for groovydoc comments (HTML)
" syntax include @groovyHtml <sfile>:p:h/html.vim
syntax include @groovyHtml runtime! syntax/html.vim
unlet b:current_syntax
syntax spell default " added by Bram
syn region groovyDocComment start="/\*\*" end="\*/" keepend contains=groovyCommentTitle,@groovyHtml,groovyDocTags,groovyTodo,@Spell
syn region groovyCommentTitle contained matchgroup=groovyDocComment start="/\*\*" matchgroup=groovyCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@groovyHtml,groovyCommentStar,groovyTodo,@Spell,groovyDocTags
syn region groovyDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
syn match groovyDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=groovyDocParam
syn match groovyDocParam contained "\s\S\+"
syn match groovyDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
syntax case match
endif
" match the special comment /**/
syn match groovyComment "/\*\*/"
" Strings and constants
syn match groovySpecialError contained "\\."
syn match groovySpecialCharError contained "[^']"
syn match groovySpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\|\$\)"
syn match groovyRegexChar contained "\\."
syn region groovyString start=+"+ end=+"+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
syn region groovyString start=+'+ end=+'+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell
syn region groovyString start=+"""+ end=+"""+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
syn region groovyString start=+'''+ end=+'''+ contains=groovySpecialChar,groovySpecialError,@Spell
if exists("groovy_regex_strings")
" regex strings interfere with the division operator and thus are disabled
" by default
syn region groovyString start='/[^/*]' end='/' contains=groovySpecialChar,groovyRegexChar,groovyELExpr
endif
" syn region groovyELExpr start=+${+ end=+}+ keepend contained
syn match groovyELExpr /\${.\{-}}/ contained
syn match groovyELExpr /\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained
hi def link groovyELExpr Identifier
" TODO: better matching. I am waiting to understand how it really works in groovy
" syn region groovyClosureParamsBraces start=+|+ end=+|+ contains=groovyClosureParams
" syn match groovyClosureParams "[ a-zA-Z0-9_*]\+" contained
" hi def link groovyClosureParams Identifier
" next line disabled, it can cause a crash for a long line
"syn match groovyStringError +"\([^"\\]\|\\.\)*$+
" disabled: in groovy strings or characters are written the same
" syn match groovyCharacter "'[^']*'" contains=groovySpecialChar,groovySpecialCharError
" syn match groovyCharacter "'\\''" contains=groovySpecialChar
" syn match groovyCharacter "'[^\\]'"
syn match groovyNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
syn match groovyNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
syn match groovyNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
syn match groovyNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
" unicode characters
syn match groovySpecial "\\u\d\{4\}"
syn cluster groovyTop add=groovyString,groovyCharacter,groovyNumber,groovySpecial,groovyStringError
if exists("groovy_highlight_functions")
if groovy_highlight_functions == "indent"
syn match groovyFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
syn region groovyFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
syn match groovyFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
syn region groovyFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
else
" This line catches method declarations at any indentation>0, but it assumes
" two things:
" 1. class names are always capitalized (ie: Button)
" 2. method names are never capitalized (except constructors, of course)
syn region groovyFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,groovyComment,groovyLineComment,@groovyClasses
endif
syn match groovyBraces "[{}]"
syn cluster groovyTop add=groovyFuncDef,groovyBraces
endif
if exists("groovy_highlight_debug")
" Strings and constants
syn match groovyDebugSpecial contained "\\\d\d\d\|\\."
syn region groovyDebugString contained start=+"+ end=+"+ contains=groovyDebugSpecial
syn match groovyDebugStringError +"\([^"\\]\|\\.\)*$+
syn match groovyDebugCharacter contained "'[^\\]'"
syn match groovyDebugSpecialCharacter contained "'\\.'"
syn match groovyDebugSpecialCharacter contained "'\\''"
syn match groovyDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
syn match groovyDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
syn match groovyDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
syn match groovyDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
syn keyword groovyDebugBoolean contained true false
syn keyword groovyDebugType contained null this super
syn region groovyDebugParen start=+(+ end=+)+ contained contains=groovyDebug.*,groovyDebugParen
" to make this work you must define the highlighting for these groups
syn match groovyDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
syn match groovyDebug "\<p\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
syn match groovyDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
syn match groovyDebug "\<trace[SL]\=\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
syn cluster groovyTop add=groovyDebug
hi def link groovyDebug Debug
hi def link groovyDebugString DebugString
hi def link groovyDebugStringError groovyError
hi def link groovyDebugType DebugType
hi def link groovyDebugBoolean DebugBoolean
hi def link groovyDebugNumber Debug
hi def link groovyDebugSpecial DebugSpecial
hi def link groovyDebugSpecialCharacter DebugSpecial
hi def link groovyDebugCharacter DebugString
hi def link groovyDebugParen Debug
hi def link DebugString String
hi def link DebugSpecial Special
hi def link DebugBoolean Boolean
hi def link DebugType Type
endif
" Match all Exception classes
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
if !exists("groovy_minlines")
let groovy_minlines = 10
endif
exec "syn sync ccomment groovyComment minlines=" . groovy_minlines
" ###################
" Groovy stuff
" syn match groovyOperator "|[ ,a-zA-Z0-9_*]\+|"
" All groovy valid tokens
" syn match groovyTokens ";\|,\|<=>\|<>\|:\|:=\|>\|>=\|=\|==\|<\|<=\|!=\|/\|/=\|\.\.|\.\.\.\|\~=\|\~=="
" syn match groovyTokens "\*=\|&\|&=\|\*\|->\|\~\|+\|-\|/\|?\|<<<\|>>>\|<<\|>>"
" Must put explicit these ones because groovy.vim mark them as errors otherwise
" syn match groovyTokens "<=>\|<>\|==\~"
"syn cluster groovyTop add=groovyTokens
" Mark these as operators
" Hightlight brackets
" syn match groovyBraces "[{}]"
" syn match groovyBraces "[\[\]]"
" syn match groovyBraces "[\|]"
if exists("groovy_mark_braces_in_parens_as_errors")
syn match groovyInParen contained "[{}]"
hi def link groovyInParen groovyError
syn cluster groovyTop add=groovyInParen
endif
" catch errors caused by wrong parenthesis
syn region groovyParenT transparent matchgroup=groovyParen start="(" end=")" contains=@groovyTop,groovyParenT1
syn region groovyParenT1 transparent matchgroup=groovyParen1 start="(" end=")" contains=@groovyTop,groovyParenT2 contained
syn region groovyParenT2 transparent matchgroup=groovyParen2 start="(" end=")" contains=@groovyTop,groovyParenT contained
syn match groovyParenError ")"
hi def link groovyParenError groovyError
" catch errors caused by wrong square parenthesis
syn region groovyParenT transparent matchgroup=groovyParen start="\[" end="\]" contains=@groovyTop,groovyParenT1
syn region groovyParenT1 transparent matchgroup=groovyParen1 start="\[" end="\]" contains=@groovyTop,groovyParenT2 contained
syn region groovyParenT2 transparent matchgroup=groovyParen2 start="\[" end="\]" contains=@groovyTop,groovyParenT contained
syn match groovyParenError "\]"
" ###############################
" java.vim default highlighting
hi def link groovyFuncDef Function
hi def link groovyBraces Function
hi def link groovyBranch Conditional
hi def link groovyUserLabelRef groovyUserLabel
hi def link groovyLabel Label
hi def link groovyUserLabel Label
hi def link groovyConditional Conditional
hi def link groovyRepeat Repeat
hi def link groovyExceptions Exception
hi def link groovyAssert Statement
hi def link groovyStorageClass StorageClass
hi def link groovyMethodDecl groovyStorageClass
hi def link groovyClassDecl groovyStorageClass
hi def link groovyScopeDecl groovyStorageClass
hi def link groovyBoolean Boolean
hi def link groovySpecial Special
hi def link groovySpecialError Error
hi def link groovySpecialCharError Error
hi def link groovyString String
hi def link groovyRegexChar String
hi def link groovyCharacter Character
hi def link groovySpecialChar SpecialChar
hi def link groovyNumber Number
hi def link groovyError Error
hi def link groovyStringError Error
hi def link groovyStatement Statement
hi def link groovyOperator Operator
hi def link groovyComment Comment
hi def link groovyDocComment Comment
hi def link groovyLineComment Comment
hi def link groovyConstant Constant
hi def link groovyTypedef Typedef
hi def link groovyTodo Todo
hi def link groovyCommentTitle SpecialComment
hi def link groovyDocTags Special
hi def link groovyDocParam Function
hi def link groovyCommentStar groovyComment
hi def link groovyType Type
hi def link groovyExternal Include
hi def link htmlComment Special
hi def link htmlCommentPart Special
hi def link groovySpaceError Error
hi def link groovyJDKBuiltin Special
hi def link groovyJDKOperOverl Operator
hi def link groovyJDKMethods Function
let b:current_syntax = "groovy"
if main_syntax == 'groovy'
unlet main_syntax
endif
let b:spell_options="contained"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
endif

196
syntax/html-1.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

94
syntax/html-2.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

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

172
syntax/odin.vim Normal file
View File

@@ -0,0 +1,172 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'odin') == -1
if exists("b:current_syntax")
finish
endif
syntax keyword odinUsing using
syntax keyword odinTransmute transmute
syntax keyword odinDistinct distinct
syntax keyword odinOpaque opaque
syntax keyword odinStruct struct
syntax keyword odinEnum enum
syntax keyword odinUnion union
syntax keyword odinBitField bit_field
syntax keyword odinBitSet bit_set
syntax keyword odinIf if
syntax keyword odinWhen when
syntax keyword odinElse else
syntax keyword odinDo do
syntax keyword odinFor for
syntax keyword odinSwitch switch
syntax keyword odinCase case
syntax keyword odinContinue continue
syntax keyword odinBreak break
syntax keyword odinSizeOf size_of
syntax keyword odinTypeInfoOf type_info_of
syntax keyword odinTypeIdOf typeid_of
syntax keyword odinTypeOf type_of
syntax keyword odinAlignOf align_of
syntax match odinTodo "TODO"
syntax match odinNote "NOTE"
syntax match odinXXX "XXX"
syntax match odinFixMe "FIXME"
syntax match odinNoCheckin "NOCHECKIN"
syntax match odinHack "HACK"
syntax keyword odinDataType string cstring bool b8 b16 b32 b64 rune any rawptr f32 f64 f32le f32be f64le f64be u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be u32be u64be u128be uint i8 i16 i32 i64 i128 i16le i32le i64le i128le i16be i32be i64be i128be int
syntax keyword odinBool true false
syntax keyword odinNull nil
syntax keyword odinDynamic dynamic
syntax keyword odinProc proc
syntax keyword odinIn in
syntax keyword odinNotIn notin
syntax keyword odinNotIn not_in
syntax keyword odinImport import
syntax keyword odinExport export
syntax keyword odinForeign foreign
syntax keyword odinConst const
syntax match odinNoinit "---"
syntax keyword odinPackage package
syntax keyword odinReturn return
syntax keyword odinDefer defer
syntax region odinChar start=/\v'/ skip=/\v\\./ end=/\v'/
syntax region odinString start=/\v"/ skip=/\v\\./ end=/\v"/
syntax match odinFunction "\v<\w*>(\s*::\s*)@="
syntax match odinDynamicFunction "\v<\w*(\s*:\=\s*\(.*\))@="
syntax match odinTagNote "@\<\w\+\>" display
syntax match odinClass "\v<[A-Z]\w+>" display
syntax match odinConstant "\v<[A-Z0-9,_]+>" display
syntax match odinRange "\.\." display
syntax match odinHalfRange "\.\.\<" display
syntax match odinTernaryQMark "?" display
syntax match odinDeclaration "\:\:\?" display
syntax match odinDeclAssign ":=" display
syntax match odinReturnOp "->" display
syntax match odinInteger "\-\?\<\d\+\>" display
syntax match odinFloat "\-\?\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=" display
syntax match odinHex "\-\?\<0x[0-9A-Fa-f]\+\>" display
syntax match odinAddressOf "&" display
syntax match odinDeref "\^" display
syntax match odinMacro "#\<\w\+\>" display
syntax match odinTemplate "$\<\w\+\>"
syntax match odinCommentNote "@\<\w\+\>" contained display
syntax region odinLineComment start=/\/\// end=/$/ contains=odinLineComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack
syntax region odinBlockComment start=/\v\/\*/ end=/\v\*\// contains=odinBlockComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack
highlight link odinUsing Keyword
highlight link odinTransmute Keyword
highlight link odinDistinct Keyword
highlight link odinOpaque Keyword
highlight link odinReturn Keyword
highlight link odinSwitch Keyword
highlight link odinCase Keyword
highlight link odinProc Keyword
highlight link odinIn Keyword
highlight link odinNotIn Keyword
highlight link odinContinue Keyword
highlight link odinBreak Keyword
highlight link odinSizeOf Keyword
highlight link odinTypeOf Keyword
highlight link odinTypeInfoOf Keyword
highlight link odinTypeIdOf Keyword
highlight link odinAlignOf Keyword
highlight link odinPackage Keyword
highlight link odinImport Keyword
highlight link odinExport Keyword
highlight link odinForeign Keyword
highlight link odinNoinit Keyword
highlight link odinDo Keyword
highlight link odinDefer Operator
highlight link odinDynamic Operator
highlight link odinRange Operator
highlight link odinHalfRange Operator
highlight link odinAssign Operator
highlight link odinAddressOf Operator
highlight link odinDeref Operator
highlight link odinDeclaration Operator
highlight link odinDeclAssign Operator
highlight link odinAssign Operator
highlight link odinTernaryQMark Operator
highlight link odinReturnOp Operator
highlight link odinString String
highlight link odinChar String
highlight link odinStruct Structure
highlight link odinEnum Structure
highlight link odinUnion Structure
highlight link odinBitField Structure
highlight link odinBitSet Structure
highlight link odinFunction Function
highlight link odinDynamicFunction Function
highlight link odinMacro Macro
highlight link odinIf Conditional
highlight link odinWhen Conditional
highlight link odinElse Conditional
highlight link odinFor Repeat
highlight link odinLineComment Comment
highlight link odinBlockComment Comment
highlight link odinCommentNote Todo
highlight link odinTodo Todo
highlight link odinNote Todo
highlight link odinXXX Todo
highlight link odinFixMe Todo
highlight link odinNoCheckin Todo
highlight link odinHack Todo
highlight link odinClass Type
highlight link odinTemplate Constant
highlight link odinTagNote Identifier
highlight link odinDataType Type
highlight link odinBool Boolean
highlight link odinConstant Constant
highlight link odinNull Type
highlight link odinInteger Number
highlight link odinFloat Float
highlight link odinHex Number
let b:current_syntax = "odin"
endif

View File

@@ -231,7 +231,7 @@ syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError star
" then you must deal with cases like ``/*/**/*/``. And don't try making it
" worse with ``\%(/\@<!\*\)\@<!``, either...
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
syn keyword rustTodo contained TODO FIXME XXX NB NOTE SAFETY
" asm! macro {{{2
syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*

View File

@@ -60,7 +60,7 @@ syn match zigCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{6}\)\)'/ contain
syn region zigBlock start="{" end="}" transparent fold
syn region zigCommentLine start="//" end="$" contains=zigTodo,@Spell
syn region zigCommentLineDoc start="////\@!" end="$" contains=zigTodo,@Spell
syn region zigCommentLineDoc start="//[/!]/\@!" end="$" contains=zigTodo,@Spell
" TODO: match only the first '\\' within the zigMultilineString as zigMultilineStringPrefix
syn match zigMultilineStringPrefix display contained /c\?\\\\/