diff options
Diffstat (limited to '')
53 files changed, 2776 insertions, 1429 deletions
diff --git a/autoload/dart.vim b/autoload/dart.vim index 2ff55cb6..0e8fb525 100644 --- a/autoload/dart.vim +++ b/autoload/dart.vim @@ -22,6 +22,7 @@ function! dart#fmt(q_args) abort if executable('dartfmt') let buffer_content = join(getline(1, '$'), "\n") let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content) + if buffer_content ==# joined_lines[:-2] | return | endif if 0 == v:shell_error let win_view = winsaveview() let lines = split(joined_lines, "\n") @@ -129,6 +130,15 @@ function! s:PackageMap() abort return [v:true, map] endfunction +" Toggle whether dartfmt is run on save or not. +function! dart#ToggleFormatOnSave() abort + if get(g:, "dart_format_on_save", 0) + let g:dart_format_on_save = 0 + return + endif + let g:dart_format_on_save = 1 +endfunction + " Finds a file name '.packages' in the cwd, or in any directory above the open " file. " diff --git a/autoload/xml/aria.vim b/autoload/xml/aria.vim index 2a3c88f0..5e642e1d 100644 --- a/autoload/xml/aria.vim +++ b/autoload/xml/aria.vim @@ -94,44 +94,61 @@ let landmark_role = [ \ ] " Ref: https://www.w3.org/TR/dpub-aria-1.0/ -" Version: W3C Candidate Recommendation 15 December 2016 +" Version: W3C Recommendation 14 December 2017 let dpub_role = [ - \ 'dpub-abstract', - \ 'dpub-afterword', - \ 'dpub-appendix', - \ 'dpub-biblioentry', - \ 'dpub-bibliography', - \ 'dpub-biblioref', - \ 'dpub-chapter', - \ 'dpub-cover', - \ 'dpub-epilogue', - \ 'dpub-footnote', - \ 'dpub-footnotes', - \ 'dpub-foreword', - \ 'dpub-glossary', - \ 'dpub-glossdef', - \ 'dpub-glossref', - \ 'dpub-glossterm', - \ 'dpub-index', - \ 'dpub-locator', - \ 'dpub-noteref', - \ 'dpub-notice', - \ 'dpub-pagebreak', - \ 'dpub-pagelist', - \ 'dpub-part', - \ 'dpub-preface', - \ 'dpub-prologue', - \ 'dpub-pullquote', - \ 'dpub-qna', - \ 'dpub-subtitle', - \ 'dpub-tip', - \ 'dpub-title', - \ 'dpub-toc' + \ 'doc-abstract', + \ 'doc-acknowledgments', + \ 'doc-afterword', + \ 'doc-appendix', + \ 'doc-backlink', + \ 'doc-biblioentry', + \ 'doc-bibliography', + \ 'doc-biblioref', + \ 'doc-chapter', + \ 'doc-colophon', + \ 'doc-conclusion', + \ 'doc-cover', + \ 'doc-credit', + \ 'doc-credits', + \ 'doc-dedication', + \ 'doc-endnote', + \ 'doc-endnotes', + \ 'doc-epigraph', + \ 'doc-epilogue', + \ 'doc-errata', + \ 'doc-example', + \ 'doc-footnote', + \ 'doc-foreword', + \ 'doc-glossary', + \ 'doc-glossref', + \ 'doc-index', + \ 'doc-introduction', + \ 'doc-noteref', + \ 'doc-notice', + \ 'doc-pagebreak', + \ 'doc-pagelist', + \ 'doc-part', + \ 'doc-preface', + \ 'doc-prologue', + \ 'doc-pullquote', + \ 'doc-qna', + \ 'doc-subtitle', + \ 'doc-tip', + \ 'doc-toc' +\ ] + +" Ref: https://www.w3.org/TR/graphics-aria-1.0/ +" Version: W3C Candidate Recommendation 29 March 2018 +let graphic_role = [ + \ 'graphics-document', + \ 'graphics-object', + \ 'graphics-symbol' \ ] let role = extend(widget_role, document_structure) let role = extend(role, landmark_role) let role = extend(role, dpub_role) +let role = extend(role, graphic_role) " https://www.w3.org/TR/wai-aria-1.1/#states_and_properties let global_states_and_properties = { diff --git a/autoload/xml/html5.vim b/autoload/xml/html5.vim index 404dd567..5a474ace 100644 --- a/autoload/xml/html5.vim +++ b/autoload/xml/html5.vim @@ -374,6 +374,8 @@ let abutton_dec = 'details\\|embed\\|iframe\\|keygen\\|label\\|menu\\|select\\|t let crossorigin = ['anonymous', 'use-credentials'] +let referrerpolicy = ['no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] + let g:xmldata_html5 = { \ 'vimxmlentities': ['AElig', 'Aacute', 'Acirc', 'Agrave', 'Alpha', 'Aring', 'Atilde', 'Auml', 'Beta', 'Ccedil', 'Chi', 'Dagger', 'Delta', 'ETH', 'Eacute', 'Ecirc', 'Egrave', 'Epsilon', 'Eta', 'Euml', 'Gamma', 'Iacute', 'Icirc', 'Igrave', 'Iota', 'Iuml', 'Kappa', 'Lambda', 'Mu', 'Ntilde', 'Nu', 'OElig', 'Oacute', 'Ocirc', 'Ograve', 'Omega', 'Omicron', 'Oslash', 'Otilde', 'Ouml', 'Phi', 'Pi', 'Prime', 'Psi', 'Rho', 'Scaron', 'Sigma', 'THORN', 'Tau', 'Theta', 'Uacute', 'Ucirc', 'Ugrave', 'Upsilon', 'Uuml', 'Xi', 'Yacute', 'Yuml', 'Zeta', 'aacute', 'acirc', 'acute', 'aelig', 'agrave', 'alefsym', 'alpha', 'amp', 'and', 'ang', 'apos', 'aring', 'asymp', 'atilde', 'auml', 'bdquo', 'beta', 'brvbar', 'bull', 'cap', 'ccedil', 'cedil', 'cent', 'chi', 'circ', 'clubs', 'cong', 'copy', 'crarr', 'cup', 'curren', 'dArr', 'dagger', 'darr', 'deg', 'delta', 'diams', 'divide', 'eacute', 'ecirc', 'egrave', 'empty', 'emsp', 'ensp', 'epsilon', 'equiv', 'eta', 'eth', 'euml', 'euro', 'exist', 'fnof', 'forall', 'frac12', 'frac14', 'frac34', 'frasl', 'gamma', 'ge', 'gt', 'hArr', 'harr', 'hearts', 'hellip', 'iacute', 'icirc', 'iexcl', 'igrave', 'image', 'infin', 'int', 'iota', 'iquest', 'isin', 'iuml', 'kappa', 'lArr', 'lambda', 'lang', 'laquo', 'larr', 'lceil', 'ldquo', 'le', 'lfloor', 'lowast', 'loz', 'lrm', 'lsaquo', 'lsquo', 'lt', 'macr', 'mdash', 'micro', 'middot', 'minus', 'mu', 'nabla', 'nbsp', 'ndash', 'ne', 'ni', 'not', 'notin', 'nsub', 'ntilde', 'nu', 'oacute', 'ocirc', 'oelig', 'ograve', 'oline', 'omega', 'omicron', 'oplus', 'or', 'ordf', 'ordm', 'oslash', 'otilde', 'otimes', 'ouml', 'para', 'part', 'permil', 'perp', 'phi', 'pi', 'piv', 'plusmn', 'pound', 'prime', 'prod', 'prop', 'psi', 'quot', 'rArr', 'radic', 'rang', 'raquo', 'rarr', 'rceil', 'rdquo', 'real', 'reg', 'rfloor', 'rho', 'rlm', 'rsaquo', 'rsquo', 'sbquo', 'scaron', 'sdot', 'sect', 'shy', 'sigma', 'sigmaf', 'sim', 'spades', 'sub', 'sube', 'sum', 'sup', 'sup1', 'sup2', 'sup3', 'supe', 'szlig', 'tau', 'there4', 'theta', 'thetasym', 'thinsp', 'thorn', 'tilde', 'times', 'trade', 'uArr', 'uacute', 'uarr', 'ucirc', 'ugrave', 'uml', 'upsih', 'upsilon', 'uuml', 'weierp', 'xi', 'yacute', 'yen', 'yuml', 'zeta', 'zwj', 'zwnj'], @@ -392,7 +394,7 @@ let g:xmldata_html5 = { \ ], \ 'area': [ \ [], - \ extend(copy(global_attributes), {'alt': [], 'href': [], 'target': [], 'rel': linktypes, 'media': [], 'hreflang': lang_tag, 'type': [], 'shape': ['rect', 'circle', 'poly', 'default'], 'coords': [], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']}) + \ extend(copy(global_attributes), {'alt': [], 'href': [], 'target': [], 'rel': linktypes, 'media': [], 'hreflang': lang_tag, 'type': [], 'shape': ['rect', 'circle', 'poly', 'default'], 'coords': [], 'referrerpolicy': referrerpolicy}) \ ], \ 'article': [ \ flow_elements + ['style'], @@ -490,6 +492,10 @@ let g:xmldata_html5 = { \ filter(copy(phrasing_elements), "!(v:val =~ 'dfn')"), \ global_attributes \ ], +\ 'dialog': [ + \ flow_elements, + \ extend(copy(global_attributes), {'open': []}) +\ ], \ 'div': [ \ flow_elements + ['style'], \ global_attributes @@ -580,11 +586,11 @@ let g:xmldata_html5 = { \ ], \ 'iframe': [ \ [], - \ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', ''], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url'], 'allowfullscreen': [], 'allowpaymentrequest': [], 'allowpresentation': [], 'allowusermedia': []}) + \ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', ''], 'referrerpolicy': referrerpolicy, 'allowfullscreen': [], 'allowpaymentrequest': [], 'allowpresentation': [], 'allowusermedia': []}) \ ], \ 'img': [ \ [], - \ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'decoding': ['async', 'sync', 'auto'], 'usemap': [], 'ismap': ['ismap', ''], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url'], 'crossorigin': ['anonymous', 'use-credentials']}) + \ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'decoding': ['async', 'sync', 'auto'], 'usemap': [], 'ismap': ['ismap', ''], 'referrerpolicy': referrerpolicy, 'crossorigin': ['anonymous', 'use-credentials']}) \ ], \ 'input': [ \ [], @@ -616,7 +622,7 @@ let g:xmldata_html5 = { \ ], \ 'link': [ \ [], - \ extend(copy(global_attributes), {'href': [], 'rel': linkreltypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'sizes': ['any'], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url'], 'crossorigin': crossorigin, 'preload': ['preload', ''], 'prefetch': ['prefetch', ''], 'as': ['report', 'document', 'document', 'object', 'embed', 'audio', 'font', 'image', 'audioworklet', 'paintworklet', 'script', 'serviceworker', 'sharedworker', 'worker', 'style', 'track', 'video', 'image', 'manifest', 'xslt', 'fetch', '']}) + \ extend(copy(global_attributes), {'href': [], 'rel': linkreltypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'sizes': ['any'], 'referrerpolicy': referrerpolicy, 'crossorigin': crossorigin, 'preload': ['preload', ''], 'prefetch': ['prefetch', ''], 'as': ['report', 'document', 'document', 'object', 'embed', 'audio', 'font', 'image', 'audioworklet', 'paintworklet', 'script', 'serviceworker', 'sharedworker', 'worker', 'style', 'track', 'video', 'image', 'manifest', 'xslt', 'fetch', '']}) \ ], \ 'main': [ \ flow_elements + ['style'], diff --git a/compiler/eruby.vim b/compiler/eruby.vim index fd9a8e59..b3c102ec 100644 --- a/compiler/eruby.vim +++ b/compiler/eruby.vim @@ -30,8 +30,8 @@ CompilerSet errorformat= \%W%f:%l:\ warning:\ %m, \%E%f:%l:in\ %*[^:]:\ %m, \%E%f:%l:\ %m, - \%-C%\tfrom\ %f:%l:in\ %.%#, - \%-Z%\tfrom\ %f:%l, + \%-C%\t%\\d%#:%#\ %#from\ %f:%l:in\ %.%#, + \%-Z%\t%\\d%#:%#\ %#from\ %f:%l, \%-Z%p^, \%-G%.%# diff --git a/compiler/rake.vim b/compiler/rake.vim index e304f8fa..fba50815 100644 --- a/compiler/rake.vim +++ b/compiler/rake.vim @@ -22,12 +22,12 @@ CompilerSet makeprg=rake CompilerSet errorformat= \%D(in\ %f), - \%\\s%#from\ %f:%l:%m, - \%\\s%#from\ %f:%l:, - \%\\s%##\ %f:%l:%m%\\&%.%#%\\D:%\\d%#:%.%#, - \%\\s%##\ %f:%l%\\&%.%#%\\D:%\\d%#, - \%\\s%#[%f:%l:\ %#%m%\\&%.%#%\\D:%\\d%#:%.%#, - \%\\s%#%f:%l:\ %#%m%\\&%.%#%\\D:%\\d%#:%.%#, + \%\\s%#%\\d%#:%#\ %#from\ %f:%l:%m, + \%\\s%#%\\d%#:%#\ %#from\ %f:%l:, + \%\\s%##\ %f:%l:%m%\\&%.%#%\\D:%\\d%\\+:%.%#, + \%\\s%##\ %f:%l%\\&%.%#%\\D:%\\d%\\+, + \%\\s%#[%f:%l:\ %#%m%\\&%.%#%\\D:%\\d%\\+:%.%#, + \%\\s%#%f:%l:\ %#%m%\\&%.%#%\\D:%\\d%\\+:%.%#, \%\\s%#%f:%l:, \%m\ [%f:%l]:, \%+Erake\ aborted!, diff --git a/compiler/rspec.vim b/compiler/rspec.vim index 8c5a5fe3..b990bd48 100644 --- a/compiler/rspec.vim +++ b/compiler/rspec.vim @@ -25,7 +25,7 @@ CompilerSet errorformat= \%E%.%#:in\ `load':\ %f:%l:%m, \%E%f:%l:in\ `%*[^']':\ %m, \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#, - \%E\ \ %\\d%\\+)%.%#, + \%E\ \ \ \ \ Failure/Error:\ %m, \%C\ \ \ \ \ %m, \%C%\\s%#, \%-G%.%# diff --git a/compiler/ruby.vim b/compiler/ruby.vim index 81721285..453b398b 100644 --- a/compiler/ruby.vim +++ b/compiler/ruby.vim @@ -23,21 +23,21 @@ set cpo-=C " default settings runs script normally " add '-c' switch to run syntax check only: " -" CompilerSet makeprg=ruby\ -wc\ $* +" CompilerSet makeprg=ruby\ -c " " or add '-c' at :make command line: " " :make -c %<CR> " -CompilerSet makeprg=ruby\ -w\ $* +CompilerSet makeprg=ruby CompilerSet errorformat= \%+E%f:%l:\ parse\ error, \%W%f:%l:\ warning:\ %m, \%E%f:%l:in\ %*[^:]:\ %m, \%E%f:%l:\ %m, - \%-C%\tfrom\ %f:%l:in\ %.%#, - \%-Z%\tfrom\ %f:%l, + \%-C%\t%\\d%#:%#\ %#from\ %f:%l:in\ %.%#, + \%-Z%\t%\\d%#:%#\ %#from\ %f:%l, \%-Z%p^, \%-G%.%# diff --git a/extras/flow.vim b/extras/flow.vim index bbb84496..d029db88 100644 --- a/extras/flow.vim +++ b/extras/flow.vim @@ -29,8 +29,9 @@ syntax region jsFlowReturnGroup contained matchgroup=jsFlowNoise start=/</ e syntax match jsFlowReturnOrOp contained /\s*|\s*/ skipwhite skipempty nextgroup=@jsFlowReturnCluster syntax match jsFlowWildcardReturn contained /*/ skipwhite skipempty nextgroup=jsFuncBlock -syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs -syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock +syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs +syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock +syntax region jsFlowClassFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs syntax region jsFlowTypeStatement start=/type\%(\s\+\k\)\@=/ end=/=\@=/ contains=jsFlowTypeOperator oneline skipwhite skipempty nextgroup=jsFlowTypeValue keepend syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/=/ end=/[\n;]/ contains=@jsFlowCluster,jsFlowGroup,jsFlowMaybe @@ -83,6 +84,7 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsFlowReturnGroup jsFlowGroup HiLink jsFlowFunctionGroup PreProc HiLink jsFlowClassGroup PreProc + HiLink jsFlowClassFunctionGroup PreProc HiLink jsFlowArrowArguments PreProc HiLink jsFlowArrow PreProc HiLink jsFlowReturnArrow PreProc diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 6bf83344..f7286b68 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -69,29 +69,26 @@ augroup filetypedetect autocmd BufNewFile,BufRead *.swift set filetype=swift augroup END -augroup filetypedetect -" apiblueprint:sheerun/apiblueprint.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'apiblueprint') == -1 + augroup filetypedetect + " apiblueprint, from apiblueprint.vim in sheerun/apiblueprint.vim autocmd BufReadPost,BufNewFile *.apib set filetype=apiblueprint autocmd FileType apiblueprint set syntax=apiblueprint autocmd FileType apiblueprint set makeprg=drafter\ -l\ % -augroup END - -augroup filetypedetect -" applescript:vim-scripts/applescript.vim -augroup END + augroup end +endif -augroup filetypedetect -" asciidoc:asciidoc/vim-asciidoc +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'asciidoc') == -1 + augroup filetypedetect + " asciidoc, from asciidoc.vim in asciidoc/vim-asciidoc autocmd BufNewFile,BufRead *.asciidoc,*.adoc \ set ft=asciidoc -augroup END - -augroup filetypedetect -" yaml:stephpy/vim-yaml -augroup END + augroup end +endif -augroup filetypedetect -" ansible:pearofducks/ansible-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 + augroup filetypedetect + " ansible, from ansible.vim in pearofducks/ansible-vim function! s:isAnsible() let filepath = expand("%:p") let filename = expand("%:t") @@ -106,62 +103,74 @@ function! s:isAnsible() return 0 endfunction -:au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en -:au BufNewFile,BufRead *.j2 set ft=ansible_template -:au BufNewFile,BufRead hosts set ft=ansible_hosts -augroup END +function! s:setupTemplate() + if exists("g:ansible_template_syntaxes") + let filepath = expand("%:p") + for syntax_name in items(g:ansible_template_syntaxes) + let s:syntax_string = '\v/'.syntax_name[0] + if filepath =~ s:syntax_string + execute 'set ft='.syntax_name[1].'.jinja2' + return + endif + endfor + endif + set ft=jinja2 +endfunction -augroup filetypedetect -" arduino:sudar/vim-arduino-syntax -au BufRead,BufNewFile *.ino,*.pde set filetype=arduino -augroup END +au BufNewFile,BufRead * if s:isAnsible() | set ft=yaml.ansible | en +au BufNewFile,BufRead *.j2 call s:setupTemplate() +au BufNewFile,BufRead hosts set ft=ansible_hosts + augroup end +endif -augroup filetypedetect -" autohotkey:hnamikaw/vim-autohotkey -augroup END +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1 + augroup filetypedetect + " arduino, from arduino.vim in sudar/vim-arduino-syntax +au BufRead,BufNewFile *.ino,*.pde set filetype=arduino + augroup end +endif -augroup filetypedetect -" blade:jwalton512/vim-blade +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1 + augroup filetypedetect + " blade, from blade.vim in jwalton512/vim-blade autocmd BufNewFile,BufRead *.blade.php set filetype=blade -augroup END - -augroup filetypedetect -" c++11:octol/vim-cpp-enhanced-highlight -augroup END - -augroup filetypedetect -" c/c++:vim-jp/vim-cpp -augroup END + augroup end +endif -augroup filetypedetect -" caddyfile:isobit/vim-caddyfile +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'caddyfile') == -1 + augroup filetypedetect + " caddyfile, from caddyfile.vim in isobit/vim-caddyfile au BufNewFile,BufRead Caddyfile set ft=caddyfile -augroup END + augroup end +endif -augroup filetypedetect -" carp:hellerve/carp-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'carp') == -1 + augroup filetypedetect + " carp, from carp.vim in hellerve/carp-vim au BufRead,BufNewFile *.carp set filetype=carp -augroup END + augroup end +endif -augroup filetypedetect -" cjsx:mtscout6/vim-cjsx +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1 + augroup filetypedetect + " cjsx, from cjsx.vim in mtscout6/vim-cjsx augroup CJSX au! autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee augroup END -augroup END + augroup end +endif -augroup filetypedetect -" clojure:guns/vim-clojure-static +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1 + augroup filetypedetect + " clojure, from clojure.vim in guns/vim-clojure-static autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot setlocal filetype=clojure -augroup END - -augroup filetypedetect -" cmake:pboettch/vim-cmake-syntax -augroup END + augroup end +endif -augroup filetypedetect -" cryptol:victoredwardocallaghan/cryptol.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cryptol') == -1 + augroup filetypedetect + " cryptol, from cryptol.vim in victoredwardocallaghan/cryptol.vim " Copyright © 2013 Edward O'Callaghan. All Rights Reserved. " Normal Cryptol Program; au! BufRead,BufNewFile *.cry set filetype=cryptol @@ -170,46 +179,54 @@ au! BufRead,BufNewFile *.cyl set filetype=cryptol au! BufRead,BufNewFile *.lcry set filetype=cryptol au! BufRead,BufNewFile *.lcyl set filetype=cryptol " Also in LaTeX *.tex which is outside our coverage scope. -augroup END + augroup end +endif -augroup filetypedetect -" crystal:rhysd/vim-crystal +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 + augroup filetypedetect + " crystal, from crystal.vim in rhysd/vim-crystal autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby -augroup END + augroup end +endif -augroup filetypedetect -" cql:elubow/cql-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1 + augroup filetypedetect + " cql, from cql.vim in elubow/cql-vim if has("autocmd") au BufNewFile,BufRead *.cql set filetype=cql endif -augroup END + augroup end +endif -augroup filetypedetect -" cucumber:tpope/vim-cucumber +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1 + augroup filetypedetect + " cucumber, from cucumber.vim in tpope/vim-cucumber " Cucumber autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber -augroup END + augroup end +endif -augroup filetypedetect -" dart:dart-lang/dart-vim-plugin +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1 + augroup filetypedetect + " dart, from dart.vim in dart-lang/dart-vim-plugin autocmd BufRead,BufNewFile *.dart set filetype=dart -augroup END - -augroup filetypedetect -" dockerfile:docker/docker::/contrib/syntax/vim/ -augroup END + augroup end +endif -augroup filetypedetect -" elm:ElmCast/elm-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1 + augroup filetypedetect + " elm, from elm.vim in ElmCast/elm-vim " detection for Elm (http://elm-lang.org/) au BufRead,BufNewFile *.elm set filetype=elm -augroup END + augroup end +endif -augroup filetypedetect -" emberscript:yalesov/vim-ember-script +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1 + augroup filetypedetect + " emberscript, from ember-script.vim in yalesov/vim-ember-script " Language: ember-script " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>> " URL: http://github.com/yalesov/vim-ember-script @@ -223,10 +240,12 @@ endif autocmd BufNewFile,BufRead *.em set filetype=ember-script autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab -augroup END + augroup end +endif -augroup filetypedetect -" emblem:yalesov/vim-emblem +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1 + augroup filetypedetect + " emblem, from emblem.vim in yalesov/vim-emblem " Language: emblem " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com> " URL: http://github.com/yalesov/vim-emblem @@ -244,26 +263,34 @@ else autocmd BufNewFile,BufRead *.em,*.emblem set filetype=emblem endif autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab -augroup END + augroup end +endif -augroup filetypedetect -" erlang:vim-erlang/vim-erlang-runtime +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1 + augroup filetypedetect + " erlang, from erlang.vim in vim-erlang/vim-erlang-runtime au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl,*.escript set ft=erlang -augroup END + augroup end +endif -augroup filetypedetect -" fsharp:fsharp/vim-fsharp:_BASIC +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fsharp') == -1 + augroup filetypedetect + " fsharp, from fsharp.vim in fsharp/vim-fsharp:_BASIC " F#, fsharp autocmd BufNewFile,BufRead *.fs,*.fsi,*.fsx set filetype=fsharp -augroup END + augroup end +endif -augroup filetypedetect -" gmpl:maelvalais/gmpl.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gmpl') == -1 + augroup filetypedetect + " gmpl, from gmpl.vim in maelvalais/gmpl.vim au BufRead,BufNewFile *.mod set filetype=gmpl -augroup END + augroup end +endif -augroup filetypedetect -" glsl:tikhomirov/vim-glsl +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1 + augroup filetypedetect + " glsl, from glsl.vim in tikhomirov/vim-glsl " Language: OpenGL Shading Language " Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io> @@ -272,14 +299,12 @@ augroup filetypedetect autocmd! BufNewFile,BufRead *.vert,*.tesc,*.tese,*.glsl,*.geom,*.frag,*.comp set filetype=glsl " vim:set sts=2 sw=2 : -augroup END - -augroup filetypedetect -" gnuplot:vim-scripts/gnuplot-syntax-highlighting -augroup END + augroup end +endif -augroup filetypedetect -" go:fatih/vim-go:_BASIC +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 + augroup filetypedetect + " go, from gofiletype.vim in fatih/vim-go:_BASIC " vint: -ProhibitAutocmdWithNoGroup " We take care to preserve the user's fileencodings and fileformats, @@ -314,57 +339,70 @@ au BufReadPost *.s call s:gofiletype_post() au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl " vim: sw=2 ts=2 et -augroup END - -augroup filetypedetect -" groovy:vim-scripts/groovy.vim -augroup END + augroup end +endif -augroup filetypedetect -" haml:sheerun/vim-haml +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1 + augroup filetypedetect + " haml, from haml.vim in sheerun/vim-haml autocmd BufNewFile,BufRead *.sass setf sass autocmd BufNewFile,BufRead *.scss setf scss -augroup END + augroup end +endif -augroup filetypedetect -" handlebars:mustache/vim-mustache-handlebars +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 + augroup filetypedetect + " handlebars, from mustache.vim in mustache/vim-mustache-handlebars if has("autocmd") au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim endif -augroup END + augroup end +endif -augroup filetypedetect -" haskell:neovimhaskell/haskell-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haproxy') == -1 + augroup filetypedetect + " haproxy, from haproxy.vim in CH-DanReif/haproxy.vim +au BufRead,BufNewFile haproxy*.c* set ft=haproxy + augroup end +endif + +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1 + augroup filetypedetect + " haskell, from haskell.vim in neovimhaskell/haskell-vim au BufRead,BufNewFile *.hsc set filetype=haskell au BufRead,BufNewFile *.bpk set filetype=haskell au BufRead,BufNewFile *.hsig set filetype=haskell -augroup END + augroup end +endif -augroup filetypedetect -" haxe:yaymukund/vim-haxe +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1 + augroup filetypedetect + " haxe, from haxe.vim in yaymukund/vim-haxe autocmd BufNewFile,BufRead *.hx setf haxe -augroup END - -augroup filetypedetect -" html5:othree/html5.vim -augroup END + augroup end +endif -augroup filetypedetect -" i3:PotatoesMaster/i3-vim-syntax +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1 + augroup filetypedetect + " i3, from i3.vim in PotatoesMaster/i3-vim-syntax augroup i3_ftdetect au! au BufRead,BufNewFile *i3/config,*sway/config set ft=i3 augroup END -augroup END + augroup end +endif -augroup filetypedetect -" jasmine:glanotte/vim-jasmine +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1 + augroup filetypedetect + " jasmine, from jasmine.vim in glanotte/vim-jasmine autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine -augroup END + augroup end +endif -augroup filetypedetect -" javascript:pangloss/vim-javascript:_JAVASCRIPT +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 + augroup filetypedetect + " javascript, from javascript.vim in pangloss/vim-javascript:_JAVASCRIPT au BufNewFile,BufRead *.{js,mjs,jsm,es,es6},Jakefile setf javascript fun! s:SourceFlowSyntax() @@ -382,42 +420,52 @@ fun! s:SelectJavascript() endif endfun au BufNewFile,BufRead * call s:SelectJavascript() -augroup END + augroup end +endif -augroup filetypedetect -" jenkins:martinda/Jenkinsfile-vim-syntax +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1 + augroup filetypedetect + " jenkins, from Jenkinsfile.vim in martinda/Jenkinsfile-vim-syntax " Jenkinsfile autocmd BufRead,BufNewFile Jenkinsfile set ft=Jenkinsfile autocmd BufRead,BufNewFile Jenkinsfile* setf Jenkinsfile autocmd BufRead,BufNewFile *.jenkinsfile set ft=Jenkinsfile autocmd BufRead,BufNewFile *.jenkinsfile setf Jenkinsfile -augroup END + augroup end +endif -augroup filetypedetect -" json:elzr/vim-json +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1 + augroup filetypedetect + " json, from json.vim in elzr/vim-json autocmd BufNewFile,BufRead *.json setlocal filetype=json autocmd BufNewFile,BufRead *.jsonl setlocal filetype=json autocmd BufNewFile,BufRead *.jsonp setlocal filetype=json autocmd BufNewFile,BufRead *.geojson setlocal filetype=json autocmd BufNewFile,BufRead *.template setlocal filetype=json -augroup END + augroup end +endif -augroup filetypedetect -" json5:GutenYe/json5.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json5') == -1 + augroup filetypedetect + " json5, from json5.vim in GutenYe/json5.vim au BufNewFile,BufRead *.json5 setfiletype json5 -augroup END + augroup end +endif -augroup filetypedetect -" jst:briancollins/vim-jst +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1 + augroup filetypedetect + " jst, from jst.vim in briancollins/vim-jst au BufNewFile,BufRead *.ejs set filetype=jst au BufNewFile,BufRead *.jst set filetype=jst au BufNewFile,BufRead *.djs set filetype=jst au BufNewFile,BufRead *.hamljs set filetype=jst au BufNewFile,BufRead *.ect set filetype=jst -augroup END + augroup end +endif -augroup filetypedetect -" jsx:mxw/vim-jsx:_ALL +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1 + augroup filetypedetect + " jsx, from javascript.vim in mxw/vim-jsx:_ALL """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Vim ftdetect file " @@ -428,7 +476,7 @@ augroup filetypedetect " Whether the .jsx extension is required. if !exists('g:jsx_ext_required') - let g:jsx_ext_required = 1 + let g:jsx_ext_required = 0 endif " Whether the @jsx pragma is required. @@ -455,25 +503,27 @@ autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1 autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx autocmd BufNewFile,BufRead *.js \ if <SID>EnableJSX() | set filetype=javascript.jsx | endif -augroup END + augroup end +endif -augroup filetypedetect -" kotlin:udalov/kotlin-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1 + augroup filetypedetect + " kotlin, from kotlin.vim in udalov/kotlin-vim autocmd BufNewFile,BufRead *.kt setfiletype kotlin autocmd BufNewFile,BufRead *.kts setfiletype kotlin -augroup END - -augroup filetypedetect -" latex:LaTeX-Box-Team/LaTeX-Box -augroup END + augroup end +endif -augroup filetypedetect -" less:groenewege/vim-less +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1 + augroup filetypedetect + " less, from less.vim in groenewege/vim-less autocmd BufNewFile,BufRead *.less setf less -augroup END + augroup end +endif -augroup filetypedetect -" liquid:tpope/vim-liquid +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1 + augroup filetypedetect + " liquid, from liquid.vim in tpope/vim-liquid " Liquid au BufNewFile,BufRead *.liquid set ft=liquid @@ -490,10 +540,12 @@ au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid \ let b:liquid_subtype = 'html' | \ set ft=liquid | -augroup END + augroup end +endif -augroup filetypedetect -" livescript:gkz/vim-ls +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1 + augroup filetypedetect + " livescript, from ls.vim in gkz/vim-ls " Language: LiveScript " Maintainer: George Zahariev " URL: http://github.com/gkz/vim-ls @@ -501,14 +553,12 @@ augroup filetypedetect " autocmd BufNewFile,BufRead *.ls set filetype=ls autocmd BufNewFile,BufRead *Slakefile set filetype=ls -augroup END - -augroup filetypedetect -" lua:tbastos/vim-lua -augroup END + augroup end +endif -augroup filetypedetect -" mako:sophacles/vim-bundle-mako +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1 + augroup filetypedetect + " mako, from mako.vim in sophacles/vim-bundle-mako if !exists("g:mako_detect_lang_from_ext") let g:mako_detect_lang_from_ext = 1 endif @@ -520,73 +570,69 @@ if g:mako_detect_lang_from_ext au BufReadPre *.*.mako execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype endif au BufRead,BufNewFile *.mako set filetype=mako -augroup END + augroup end +endif -augroup filetypedetect -" markdown:plasticboy/vim-markdown:_SYNTAX +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1 + augroup filetypedetect + " markdown, from markdown.vim in plasticboy/vim-markdown:_SYNTAX " markdown filetype file au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown -augroup END - -augroup filetypedetect -" mathematica:rsmenon/vim-mathematica -augroup END + augroup end +endif -augroup filetypedetect -" nginx:chr4/nginx.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1 + augroup filetypedetect + " nginx, from nginx.vim in chr4/nginx.vim au BufRead,BufNewFile *.nginx set ft=nginx au BufRead,BufNewFile nginx*.conf set ft=nginx au BufRead,BufNewFile *nginx.conf set ft=nginx au BufRead,BufNewFile */etc/nginx/* set ft=nginx au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx -augroup END + augroup end +endif -augroup filetypedetect -" nim:zah/nim.vim:_BASIC +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1 + augroup filetypedetect + " nim, from nim.vim in zah/nim.vim:_BASIC au BufNewFile,BufRead *.nim,*.nims set filetype=nim + augroup end +endif -augroup END - -augroup filetypedetect -" nix:LnL7/vim-nix +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1 + augroup filetypedetect + " nix, from nix.vim in LnL7/vim-nix " Vim filetype detect " Language: Nix " Maintainer: Daiderd Jordan <daiderd@gmail.com> " URL: https://github.com/LnL7/vim-nix au BufRead,BufNewFile *.nix set filetype=nix -au FileType nix setl sw=2 sts=2 et iskeyword+=- -augroup END - -augroup filetypedetect -" objc:b4winckler/vim-objc -augroup END - -augroup filetypedetect -" ocaml:jrk/vim-ocaml -augroup END - -augroup filetypedetect -" octave:vim-scripts/octave.vim-- -augroup END + augroup end +endif -augroup filetypedetect -" opencl:petRUShka/vim-opencl +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1 + augroup filetypedetect + " opencl, from opencl.vim in petRUShka/vim-opencl au! BufRead,BufNewFile *.cl set filetype=opencl -augroup END + augroup end +endif -augroup filetypedetect -" perl:vim-perl/vim-perl +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 + augroup filetypedetect + " perl, from mason-in-html.vim in vim-perl/vim-perl " Highlight .html files as Mason if they start with Mason tags autocmd BufRead *.html \ if getline(1) =~ '^\(%\|<[%&].*>\)' | \ set filetype=mason | \ endif -augroup END + augroup end +endif -augroup filetypedetect -" perl:vim-perl/vim-perl +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 + augroup filetypedetect + " perl, from perl11.vim in vim-perl/vim-perl function! s:DetectPerl6() let line_no = 1 let eof = line('$') @@ -621,20 +667,20 @@ endfunction autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6() autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6 -augroup END + augroup end +endif -augroup filetypedetect -" pgsql:exu/pgsql.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1 + augroup filetypedetect + " pgsql, from pgsql.vim in exu/pgsql.vim " postgreSQL au BufNewFile,BufRead *.pgsql setf pgsql -augroup END - -augroup filetypedetect -" php:StanAngeloff/php.vim -augroup END + augroup end +endif -augroup filetypedetect -" powershell:PProvost/vim-ps1 +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1 + augroup filetypedetect + " powershell, from ps1.vim in PProvost/vim-ps1 " Vim ftdetect plugin file " Language: Windows PowerShell " Maintainer: Peter Provost <peter@provost.org> @@ -646,10 +692,12 @@ au BufNewFile,BufRead *.ps1 set ft=ps1 au BufNewFile,BufRead *.psd1 set ft=ps1 au BufNewFile,BufRead *.psm1 set ft=ps1 au BufNewFile,BufRead *.pssc set ft=ps1 -augroup END + augroup end +endif -augroup filetypedetect -" powershell:PProvost/vim-ps1 +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1 + augroup filetypedetect + " powershell, from ps1xml.vim in PProvost/vim-ps1 " Vim ftdetect plugin file " Language: Windows PowerShell " Maintainer: Peter Provost <peter@provost.org> @@ -658,10 +706,12 @@ augroup filetypedetect " Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327 au BufNewFile,BufRead *.ps1xml set ft=ps1xml -augroup END + augroup end +endif -augroup filetypedetect -" powershell:PProvost/vim-ps1 +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1 + augroup filetypedetect + " powershell, from xml.vim in PProvost/vim-ps1 " Vim ftdetect plugin file " Language: Windows PowerShell " Maintainer: Peter Provost <peter@provost.org> @@ -671,81 +721,79 @@ augroup filetypedetect au BufNewFile,BufRead *.cdxml set ft=xml au BufNewFile,BufRead *.psc1 set ft=xml -augroup END + augroup end +endif -augroup filetypedetect -" protobuf:uarun/vim-protobuf +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1 + augroup filetypedetect + " protobuf, from proto.vim in uarun/vim-protobuf autocmd BufNewFile,BufRead *.proto setfiletype proto -augroup END + augroup end +endif -augroup filetypedetect -" pug:digitaltoad/vim-pug +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1 + augroup filetypedetect + " pug, from pug.vim in digitaltoad/vim-pug " Pug autocmd BufNewFile,BufReadPost *.pug set filetype=pug " Jade autocmd BufNewFile,BufReadPost *.jade set filetype=pug -augroup END + augroup end +endif -augroup filetypedetect -" puppet:voxpupuli/vim-puppet +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1 + augroup filetypedetect + " puppet, from puppet.vim in voxpupuli/vim-puppet au! BufRead,BufNewFile *.pp setfiletype puppet au! BufRead,BufNewFile Puppetfile setfiletype ruby -augroup END + augroup end +endif -augroup filetypedetect -" purescript:purescript-contrib/purescript-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1 + augroup filetypedetect + " purescript, from purescript.vim in purescript-contrib/purescript-vim au BufNewFile,BufRead *.purs setf purescript au FileType purescript let &l:commentstring='{--%s--}' -augroup END - -augroup filetypedetect -" python:vim-python/python-syntax -augroup END + augroup end +endif -augroup filetypedetect -" python-compiler:aliev/vim-compiler-python +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1 + augroup filetypedetect + " python-compiler, from python.vim in aliev/vim-compiler-python " Vim compiler file " Compiler: Unit testing tool for Python " Maintainer: Ali Aliev <ali@aliev.me> " Last Change: 2015 Nov 2 autocmd FileType python compiler python -augroup END - -augroup filetypedetect -" python-ident:Vimjas/vim-python-pep8-indent -augroup END + augroup end +endif -augroup filetypedetect -" qml:peterhoeg/vim-qml +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1 + augroup filetypedetect + " qml, from qml.vim in peterhoeg/vim-qml autocmd BufRead,BufNewFile *.qml setfiletype qml -augroup END - -augroup filetypedetect -" r-lang:vim-scripts/R.vim -augroup END + augroup end +endif -augroup filetypedetect -" racket:wlangstroth/vim-racket +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1 + augroup filetypedetect + " racket, from racket.vim in wlangstroth/vim-racket au BufRead,BufNewFile *.rkt,*.rktl set filetype=racket -augroup END + augroup end +endif -augroup filetypedetect -" raml:IN3D/vim-raml +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'raml') == -1 + augroup filetypedetect + " raml, from raml.vim in IN3D/vim-raml au BufRead,BufNewFile *.raml set ft=raml -augroup END - -augroup filetypedetect -" ragel:jneen/ragel.vim -augroup END - -augroup filetypedetect -" rspec:sheerun/rspec.vim -augroup END + augroup end +endif -augroup filetypedetect -" ruby:vim-ruby/vim-ruby +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 + augroup filetypedetect + " ruby, from ruby.vim in vim-ruby/vim-ruby " Officially distributed filetypes " Support functions {{{ @@ -788,10 +836,12 @@ au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby') " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: -augroup END + augroup end +endif -augroup filetypedetect -" ruby:vim-ruby/vim-ruby +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 + augroup filetypedetect + " ruby, from ruby_extra.vim in vim-ruby/vim-ruby " All other filetypes " Support functions {{{ @@ -855,62 +905,80 @@ au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby') au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby') " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: -augroup END + augroup end +endif -augroup filetypedetect -" rust:rust-lang/rust.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 + augroup filetypedetect + " rust, from rust.vim in rust-lang/rust.vim au BufRead,BufNewFile *.rs set filetype=rust -augroup END + augroup end +endif -augroup filetypedetect -" sbt:derekwyatt/vim-sbt +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1 + augroup filetypedetect + " sbt, from sbt.vim in derekwyatt/vim-sbt " Vim detect file " Language: sbt " Maintainer: Derek Wyatt <derek@{myfirstname}{mylastname}.org> " Last Change: 2012 Jan 19 au BufRead,BufNewFile *.sbt set filetype=sbt.scala -augroup END + augroup end +endif -augroup filetypedetect -" scss:cakebaker/scss-syntax.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1 + augroup filetypedetect + " scss, from scss.vim in cakebaker/scss-syntax.vim au BufRead,BufNewFile *.scss setfiletype scss au BufEnter *.scss :syntax sync fromstart -augroup END + augroup end +endif -augroup filetypedetect -" slim:slim-template/vim-slim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1 + augroup filetypedetect + " slim, from slim.vim in slim-template/vim-slim autocmd BufNewFile,BufRead *.slim setfiletype slim -augroup END + augroup end +endif -augroup filetypedetect -" slime:slime-lang/vim-slime-syntax +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slime') == -1 + augroup filetypedetect + " slime, from slime.vim in slime-lang/vim-slime-syntax autocmd BufNewFile,BufRead *.slime set filetype=slime -augroup END + augroup end +endif -augroup filetypedetect -" solidity:tomlion/vim-solidity +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1 + augroup filetypedetect + " solidity, from solidity.vim in tomlion/vim-solidity au BufNewFile,BufRead *.sol setf solidity -augroup END + augroup end +endif -augroup filetypedetect -" stylus:wavded/vim-stylus +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1 + augroup filetypedetect + " stylus, from stylus.vim in wavded/vim-stylus " Stylus autocmd BufNewFile,BufReadPost *.styl set filetype=stylus autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus -augroup END + augroup end +endif -augroup filetypedetect -" sxhkd:baskerville/vim-sxhkdrc +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sxhkd') == -1 + augroup filetypedetect + " sxhkd, from sxhkdrc.vim in baskerville/vim-sxhkdrc if &compatible || v:version < 603 finish endif autocmd BufNewFile,BufRead sxhkdrc,*.sxhkdrc set ft=sxhkdrc -augroup END + augroup end +endif -augroup filetypedetect -" systemd:kurayama/systemd-vim-syntax +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1 + augroup filetypedetect + " systemd, from systemd.vim in kurayama/systemd-vim-syntax au BufNewFile,BufRead *.automount set filetype=systemd au BufNewFile,BufRead *.mount set filetype=systemd au BufNewFile,BufRead *.path set filetype=systemd @@ -919,17 +987,21 @@ au BufNewFile,BufRead *.socket set filetype=systemd au BufNewFile,BufRead *.swap set filetype=systemd au BufNewFile,BufRead *.target set filetype=systemd au BufNewFile,BufRead *.timer set filetype=systemd -augroup END + augroup end +endif -augroup filetypedetect -" terraform:hashivim/vim-terraform +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1 + augroup filetypedetect + " terraform, from terraform.vim in hashivim/vim-terraform au BufRead,BufNewFile *.tf setlocal filetype=terraform au BufRead,BufNewFile *.tfvars setlocal filetype=terraform au BufRead,BufNewFile *.tfstate setlocal filetype=javascript -augroup END + augroup end +endif -augroup filetypedetect -" textile:timcharper/textile.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1 + augroup filetypedetect + " textile, from textile.vim in timcharper/textile.vim " textile.vim " " Tim Harper (tim.theenchanter.com) @@ -938,87 +1010,94 @@ augroup filetypedetect " This will override the system ftplugin/changelog " set on some distros au BufRead,BufNewFile *.textile set filetype=textile -augroup END + augroup end +endif -augroup filetypedetect -" thrift:solarnz/thrift.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1 + augroup filetypedetect + " thrift, from thrift.vim in solarnz/thrift.vim au BufNewFile,BufRead *.thrift setlocal filetype=thrift -augroup END + augroup end +endif -augroup filetypedetect -" tmux:keith/tmux.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1 + augroup filetypedetect + " tmux, from tmux.vim in keith/tmux.vim autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux -augroup END - -augroup filetypedetect -" tomdoc:wellbredgrapefruit/tomdoc.vim -augroup END + augroup end +endif -augroup filetypedetect -" toml:cespare/vim-toml +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1 + augroup filetypedetect + " toml, from toml.vim in cespare/vim-toml " Go dep and Rust use several TOML config files that are not named with .toml. -autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config set filetype=toml -augroup END +autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,Pipfile set filetype=toml + augroup end +endif -augroup filetypedetect -" twig:lumiliet/vim-twig +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'twig') == -1 + augroup filetypedetect + " twig, from twig.vim in lumiliet/vim-twig if !exists('g:vim_twig_filetype_detected') && has("autocmd") au BufNewFile,BufRead *.twig set filetype=html.twig au BufNewFile,BufRead *.html.twig set filetype=html.twig au BufNewFile,BufRead *.xml.twig set filetype=xml.twig endif -augroup END + augroup end +endif -augroup filetypedetect -" typescript:leafgarland/typescript-vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1 + augroup filetypedetect + " typescript, from typescript.vim in leafgarland/typescript-vim " use `set filetype` to override default filetype=xml for *.ts files autocmd BufNewFile,BufRead *.ts set filetype=typescript " use `setfiletype` to not override any other plugins like ianks/vim-tsx autocmd BufNewFile,BufRead *.tsx setfiletype typescript -augroup END + augroup end +endif -augroup filetypedetect -" vala:arrufat/vala.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1 + augroup filetypedetect + " vala, from vala.vim in arrufat/vala.vim autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m au BufRead,BufNewFile *.vala,*.vapi,*.valadoc setfiletype vala -augroup END - -augroup filetypedetect -" vbnet:vim-scripts/vbnet.vim -augroup END + augroup end +endif -augroup filetypedetect -" vcl:smerrill/vcl-vim-plugin +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1 + augroup filetypedetect + " vcl, from vcl.vim in smerrill/vcl-vim-plugin au BufRead,BufNewFile *.vcl set filetype=vcl -augroup END + augroup end +endif -augroup filetypedetect -" vifm:vifm/vifm.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1 + augroup filetypedetect + " vifm, from vifm-rename.vim in vifm/vifm.vim autocmd BufRead,BufNewFile vifm.rename* :set filetype=vifm-rename -augroup END + augroup end +endif -augroup filetypedetect -" vifm:vifm/vifm.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1 + augroup filetypedetect + " vifm, from vifm.vim in vifm/vifm.vim autocmd BufRead,BufNewFile vifmrc :set filetype=vifm autocmd BufRead,BufNewFile *vifm/colors/* :set filetype=vifm -augroup END + augroup end +endif -augroup filetypedetect -" vue:posva/vim-vue -au BufNewFile,BufRead *.vue setf vue -augroup END +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1 + augroup filetypedetect + " vue, from vue.vim in posva/vim-vue +au BufNewFile,BufRead *.vue,*.wpy setf vue + augroup end +endif -augroup filetypedetect -" vm:lepture/vim-velocity +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1 + augroup filetypedetect + " vm, from velocity.vim in lepture/vim-velocity au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity -augroup END - -augroup filetypedetect -" xls:vim-scripts/XSLT-syntax -augroup END - -augroup filetypedetect -" yard:sheerun/vim-yardoc -augroup END + augroup end +endif diff --git a/ftplugin/ansible.vim b/ftplugin/ansible.vim index e068dd3a..5f2f3f74 100644 --- a/ftplugin/ansible.vim +++ b/ftplugin/ansible.vim @@ -4,6 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 if exists('+regexpengine') && ('®expengine' == 0) setlocal regexpengine=1 endif +set isfname+=@-@ set path+=./../templates,./../files,templates,files endif diff --git a/ftplugin/cabal.vim b/ftplugin/cabal.vim deleted file mode 100644 index 5c041bd3..00000000 --- a/ftplugin/cabal.vim +++ /dev/null @@ -1,9 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1 - -if exists("g:loaded_haskellvim_cabal") - finish -endif - -let g:loaded_haskellvim_cabal = 1 - -endif diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim index c02bff35..debaa10a 100644 --- a/ftplugin/elixir.vim +++ b/ftplugin/elixir.vim @@ -32,11 +32,7 @@ let &l:path = setlocal includeexpr=elixir#util#get_filename(v:fname) setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl -if empty(&formatprg) - setlocal formatprg=mix\ format\ - -endif - -let &l:define = 'def\(macro|guard|delegate\)p' +let &l:define = 'def\(macro\|guard\|delegate\)\=p\=' silent! setlocal formatoptions-=t formatoptions+=croqlj diff --git a/ftplugin/haskell.vim b/ftplugin/haskell.vim deleted file mode 100644 index b1028620..00000000 --- a/ftplugin/haskell.vim +++ /dev/null @@ -1,20 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1 - -if exists("g:loaded_haskellvim_haskell") - finish -endif - -let g:loaded_haskellvim_haskell = 1 - -function! haskell#sortImports(line1, line2) - exe a:line1 . "," . a:line2 . "sort /import\\s\\+\\(qualified\\s\\+\\)\\?/" -endfunction - -function! haskell#formatImport(line1, line2) - exec a:line1 . ",". a:line2 . "s/import\\s\\+\\([A-Z].*\\)/import \\1" -endfunction - -command! -buffer -range HaskellSortImports call haskell#sortImports(<line1>, <line2>) -command! -buffer -range HaskellFormatImport call haskell#formatImport(<line1>, <line2>) - -endif diff --git a/ftplugin/nix.vim b/ftplugin/nix.vim index 8f3cf812..52c0ee69 100644 --- a/ftplugin/nix.vim +++ b/ftplugin/nix.vim @@ -11,7 +11,12 @@ endif let b:did_ftplugin = 1 -setlocal comments=:# -setlocal commentstring=#\ %s +setlocal + \ comments=:# + \ commentstring=#\ %s + \ shiftwidth=2 + \ softtabstop=2 + \ expandtab + \ iskeyword+=- endif diff --git a/ftplugin/purescript.vim b/ftplugin/purescript.vim index 695a4108..37951f44 100644 --- a/ftplugin/purescript.vim +++ b/ftplugin/purescript.vim @@ -1,6 +1,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1 -setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:-- +setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--\ \|,:-- setlocal include=^import setlocal includeexpr=printf('%s.purs',substitute(v:fname,'\\.','/','g')) diff --git a/indent/haskell.vim b/indent/haskell.vim index 5a337144..11cca26b 100644 --- a/indent/haskell.vim +++ b/indent/haskell.vim @@ -320,7 +320,7 @@ function! GetHaskellIndent() " newtype Foo = Foo " >>deriving - if l:prevline =~ '\C\s*\<\(newtype\|data\)\>[^{]\+' && l:line =~ '\C^\s*\<deriving\>' + if l:prevline =~ '\C^\s*\<\(newtype\|data\)\>[^{]\+' && l:line =~ '\C^\s*\<deriving\>' return match(l:prevline, '\S') + &shiftwidth endif diff --git a/indent/html.vim b/indent/html.vim index 1e5691f7..defaca2a 100644 --- a/indent/html.vim +++ b/indent/html.vim @@ -1,466 +1,1065 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1 -" Description: HTML5 and inline SVG indenter -" Changed By: HT de Beer <H.T.de.Beer@gmail.com> -" Last Change: 20121013 -" Added the SVG elements to the list of indenting element. SVG elements -" taken from http://www.w3.org/TR/SVG/eltindex.html -" -" Description: html5 (and html4) indenter -" Changed By: Brian Gershon <brian.five@gmail.com> -" Last Change: 30 Jan 2011 -" -" 1. Started with vim72 html indent file authored by Johannes Zellner (below) -" 2. Added html5 list as described here: -" http://stackoverflow.com/questions/3232518/how-to-update-vim-to-color-code-new-html-elements -" 3. Added this to a fork of https://github.com/othree/html5.vim -" which already provides nice html5 syntax highlighting. +" Vim indent script for HTML +" Header: "{{{ +" Maintainer: Bram Moolenaar +" Original Author: Andy Wokula <anwoku@yahoo.de> +" Last Change: 2017 Jun 13 +" Version: 1.0 +" Description: HTML indent script with cached state for faster indenting on a +" range of lines. +" Supports template systems through hooks. +" Supports Closure stylesheets. " -" Description: html indenter -" Author: Johannes Zellner <johannes@zellner.org> -" Last Change: Mo, 05 Jun 2006 22:32:41 CEST -" Restoring 'cpo' and 'ic' added by Bram 2006 May 5 -" Globals: -" let g:html_indent_tags = 'html\|p\|time' -" let g:html_exclude_tags = ['html', 'style', 'script', 'body'] - - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish +" Credits: +" indent/html.vim (2006 Jun 05) from J. Zellner +" indent/css.vim (2006 Dec 20) from N. Weibull +" +" History: +" 2014 June (v1.0) overhaul (Bram) +" 2012 Oct 21 (v0.9) added support for shiftwidth() +" 2011 Sep 09 (v0.8) added HTML5 tags (thx to J. Zuckerman) +" 2008 Apr 28 (v0.6) revised customization +" 2008 Mar 09 (v0.5) fixed 'indk' issue (thx to C.J. Robinson) +"}}} + +" Init Folklore, check user settings (2nd time ++) +if exists("b:did_indent") "{{{ + finish endif -runtime! indent/javascript.vim -let s:jsindent = &indentexpr -unlet b:did_indent -runtime! indent/css.vim -let s:cssindent = &indentexpr -let b:did_indent = 1 -" [-- local settings (must come before aborting the script) --] -setlocal indentexpr=HtmlIndentGet(v:lnum) -setlocal indentkeys=o,O,*<Return>,<>>,{,},!^F - - -let s:tags = [] -let s:no_tags = [] - -" [-- <ELEMENT ? - - ...> --] -call add(s:tags, 'a') -call add(s:tags, 'abbr') -call add(s:tags, 'acronym') -call add(s:tags, 'address') -call add(s:tags, 'b') -call add(s:tags, 'bdo') -call add(s:tags, 'big') -call add(s:tags, 'blockquote') -call add(s:tags, 'button') -call add(s:tags, 'caption') -call add(s:tags, 'center') -call add(s:tags, 'cite') -call add(s:tags, 'code') -call add(s:tags, 'colgroup') -call add(s:tags, 'del') -call add(s:tags, 'dfn') -call add(s:tags, 'dir') -call add(s:tags, 'div') -call add(s:tags, 'dl') -call add(s:tags, 'dt') -call add(s:tags, 'dd') -call add(s:tags, 'em') -call add(s:tags, 'fieldset') -call add(s:tags, 'font') -call add(s:tags, 'form') -call add(s:tags, 'frameset') -call add(s:tags, 'h1') -call add(s:tags, 'h2') -call add(s:tags, 'h3') -call add(s:tags, 'h4') -call add(s:tags, 'h5') -call add(s:tags, 'h6') -call add(s:tags, 'i') -call add(s:tags, 'iframe') -call add(s:tags, 'ins') -call add(s:tags, 'kbd') -call add(s:tags, 'label') -call add(s:tags, 'legend') -call add(s:tags, 'li') -call add(s:tags, 'map') -call add(s:tags, 'menu') -call add(s:tags, 'noframes') -call add(s:tags, 'noscript') -call add(s:tags, 'object') -call add(s:tags, 'ol') -call add(s:tags, 'optgroup') -call add(s:tags, 'p') -" call add(s:tags, 'pre') -call add(s:tags, 'q') -call add(s:tags, 's') -call add(s:tags, 'samp') -call add(s:tags, 'script') -call add(s:tags, 'select') -call add(s:tags, 'small') -call add(s:tags, 'span') -call add(s:tags, 'strong') -call add(s:tags, 'style') -call add(s:tags, 'sub') -call add(s:tags, 'sup') -call add(s:tags, 'table') -call add(s:tags, 'textarea') -call add(s:tags, 'title') -call add(s:tags, 'tt') -call add(s:tags, 'u') -call add(s:tags, 'ul') -call add(s:tags, 'var') - -" New HTML 5 elements -call add(s:tags, 'article') -call add(s:tags, 'aside') -call add(s:tags, 'audio') -call add(s:tags, 'canvas') -call add(s:tags, 'datalist') -call add(s:tags, 'details') -call add(s:tags, 'figcaption') -call add(s:tags, 'figure') -call add(s:tags, 'footer') -call add(s:tags, 'header') -call add(s:tags, 'hgroup') -call add(s:tags, 'main') -call add(s:tags, 'mark') -call add(s:tags, 'meter') -call add(s:tags, 'nav') -call add(s:tags, 'output') -call add(s:tags, 'progress') -call add(s:tags, 'picture') -call add(s:tags, 'rb') -call add(s:tags, 'rp') -call add(s:tags, 'rt') -call add(s:tags, 'rtc') -call add(s:tags, 'ruby') -call add(s:tags, 'section') -call add(s:tags, 'source') -call add(s:tags, 'summary') -call add(s:tags, 'time') -call add(s:tags, 'video') -call add(s:tags, 'bdi') -call add(s:tags, 'data') - -" Web Component -call add(s:tags, 'template') - -" Common inline used SVG elements -call add(s:tags, 'clipPath') -call add(s:tags, 'defs') -call add(s:tags, 'desc') -call add(s:tags, 'filter') -call add(s:tags, 'foreignObject') -call add(s:tags, 'g') -call add(s:tags, 'linearGradient') -call add(s:tags, 'marker') -call add(s:tags, 'mask') -call add(s:tags, 'pattern') -call add(s:tags, 'radialGradient') -call add(s:tags, 'svg') -call add(s:tags, 'switch') -call add(s:tags, 'symbol') -call add(s:tags, 'text') -call add(s:tags, 'textPath') -call add(s:tags, 'tref') -call add(s:tags, 'tspan') -" Common self closing SVG elements -call add(s:no_tags, 'animate') -call add(s:no_tags, 'animateTransform') -call add(s:no_tags, 'circle') -call add(s:no_tags, 'ellipse') -call add(s:no_tags, 'feBlend') -call add(s:no_tags, 'feColorMatrix') -call add(s:no_tags, 'feComposite') -call add(s:no_tags, 'feConvolveMatrix') -call add(s:no_tags, 'feDisplacementMap') -call add(s:no_tags, 'feFlood') -call add(s:no_tags, 'feFuncR') -call add(s:no_tags, 'feFuncG') -call add(s:no_tags, 'feFuncB') -call add(s:no_tags, 'feFuncA') -call add(s:no_tags, 'feGaussianBlur') -call add(s:no_tags, 'feImage') -call add(s:no_tags, 'feMergeNode') -call add(s:no_tags, 'feMorphology') -call add(s:no_tags, 'feOffset') -call add(s:no_tags, 'fePointLight') -call add(s:no_tags, 'feSpotLight') -call add(s:no_tags, 'feTile') -call add(s:no_tags, 'feTurbulence') -call add(s:no_tags, 'hatchpath') -call add(s:no_tags, 'hkern') -call add(s:no_tags, 'image') -call add(s:no_tags, 'line') -call add(s:no_tags, 'mpath') -call add(s:no_tags, 'polygon') -call add(s:no_tags, 'polyline') -call add(s:no_tags, 'path') -call add(s:no_tags, 'rect') -call add(s:no_tags, 'solidColor') -call add(s:no_tags, 'stop') -call add(s:no_tags, 'use') -call add(s:no_tags, 'view') -call add(s:no_tags, 'vkern') - -call add(s:tags, 'html') -call add(s:tags, 'head') -call add(s:tags, 'body') - -call add(s:tags, 'thead') -call add(s:tags, 'tbody') -call add(s:tags, 'tfoot') -call add(s:tags, 'tr') -call add(s:tags, 'th') -call add(s:tags, 'td') - -call add(s:no_tags, 'base') -call add(s:no_tags, 'link') -call add(s:no_tags, 'meta') -call add(s:no_tags, 'hr') -call add(s:no_tags, 'br') -call add(s:no_tags, 'wbr') -call add(s:no_tags, 'img') -call add(s:no_tags, 'embed') -call add(s:no_tags, 'param') -call add(s:no_tags, 'source') -call add(s:no_tags, 'track') -call add(s:no_tags, 'area') -call add(s:no_tags, 'col') -call add(s:no_tags, 'input') -call add(s:no_tags, 'keygen') -call add(s:no_tags, 'menuitem') - -let s:omittable = [ - \ ['address', 'article', 'aside', 'blockquote', 'dir', 'div', 'dl', 'fieldset', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'], - \ ['dt', 'dd'], - \ ['li'], - \ ['thead', 'tbody', 'tfoot'], - \ ['th', 'td'], - \] - - -let s:html_noindent_tags = join(s:no_tags, '\|') - -if exists('g:html_exclude_tags') - for tag in g:html_exclude_tags - call remove(s:tags, index(s:tags, tag)) - endfor - let s:html_noindent_tags = s:html_noindent_tags.'\|'.join(g:html_exclude_tags, '\|') +" Load the Javascript indent script first, it defines GetJavascriptIndent(). +" Undo the rest. +" Load base python indent. +if !exists('*GetJavascriptIndent') + runtime! indent/javascript.vim endif +let b:did_indent = 1 + +setlocal indentexpr=HtmlIndent() +setlocal indentkeys=o,O,<Return>,<>>,{,},!^F + +" Needed for % to work when finding start/end of a tag. +setlocal matchpairs+=<:> + +let b:undo_indent = "setlocal inde< indk<" -" let s:html_indent_tags = join(s:tags, '\|') -let s:html_indent_tags = '[a-z_][a-z0-9_.-]*' -" if exists('g:html_indent_tags') - " let s:html_indent_tags = s:html_indent_tags.'\|'.g:html_indent_tags -" endif +" b:hi_indent keeps state to speed up indenting consecutive lines. +let b:hi_indent = {"lnum": -1} +"""""" Code below this is loaded only once. """"" +if exists("*HtmlIndent") && !exists('g:force_reload_html') + call HtmlIndent_CheckUserSettings() + finish +endif + +" Allow for line continuation below. let s:cpo_save = &cpo set cpo-=C +"}}} -func! <SID>HtmlIndentPatternCount(content, pattern) - let s = substitute('x'.a:content, a:pattern, "\1", 'g') - let s = substitute(s, "[^\1].*$", '', '') - return strlen(s) -endfun - -" [-- count indent-increasing tags of line a:lnum --] -fun! <SID>HtmlIndentOpen(lnum, pattern) - return <SID>HtmlIndentPatternCount(getline(a:lnum), - \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)') -endfun - -" [-- count indent-decreasing tags of line a:lnum --] -fun! <SID>HtmlIndentClose(lnum, pattern) - return <SID>HtmlIndentPatternCount(getline(a:lnum), - \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)') -endfun - -" [-- count self close tags of line a:lnum --] -fun! <SID>HtmlIndentSelfClose(lnum, pattern) - return <SID>HtmlIndentPatternCount(getline(a:lnum), - \ '.\{-}\(\(<\('.a:pattern.'\).*\)\@<!\/>\)') -endfun - -" [-- count indent-increasing '{' of (java|css) line a:lnum --] -fun! <SID>HtmlIndentOpenAlt(lnum) - return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g')) -endfun - -" [-- count indent-decreasing '}' of (java|css) line a:lnum --] -fun! <SID>HtmlIndentCloseAlt(lnum) - return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g')) -endfun - -" [-- return the sum of indents respecting the syntax of a:lnum --] -fun! <SID>HtmlIndentSum(lnum, style) - if a:style == match(getline(a:lnum), '^\s*</') - if a:style == match(getline(a:lnum), '^\s*</\<\('.s:html_indent_tags.'\)\>') - let open = <SID>HtmlIndentOpen(a:lnum, s:html_indent_tags) - <SID>HtmlIndentOpen(a:lnum, s:html_noindent_tags) - let close = <SID>HtmlIndentClose(a:lnum, s:html_indent_tags) - <SID>HtmlIndentClose(a:lnum, s:html_noindent_tags) - let self_close = <SID>HtmlIndentSelfClose(a:lnum, s:html_noindent_tags) - if 0 != open || 0 != close || 0 != self_close - return open - close - self_close - endif - endif - endif +" Check and process settings from b:html_indent and g:html_indent... variables. +" Prefer using buffer-local settings over global settings, so that there can +" be defaults for all HTML files and exceptions for specific types of HTML +" files. +func! HtmlIndent_CheckUserSettings() + "{{{ + let inctags = '' + if exists("b:html_indent_inctags") + let inctags = b:html_indent_inctags + elseif exists("g:html_indent_inctags") + let inctags = g:html_indent_inctags + endif + let b:hi_tags = {} + if len(inctags) > 0 + call s:AddITags(b:hi_tags, split(inctags, ",")) + endif - if '' != &syntax && - \ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' && - \ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name') - \ =~ '\(css\|java\).*' - if a:style == match(getline(a:lnum), '^\s*}') - return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum) - endif + let autotags = '' + if exists("b:html_indent_autotags") + let autotags = b:html_indent_autotags + elseif exists("g:html_indent_autotags") + let autotags = g:html_indent_autotags + endif + let b:hi_removed_tags = {} + if len(autotags) > 0 + call s:RemoveITags(b:hi_removed_tags, split(autotags, ",")) + endif + + " Syntax names indicating being inside a string of an attribute value. + let string_names = [] + if exists("b:html_indent_string_names") + let string_names = b:html_indent_string_names + elseif exists("g:html_indent_string_names") + let string_names = g:html_indent_string_names + endif + let b:hi_insideStringNames = ['htmlString'] + if len(string_names) > 0 + for s in string_names + call add(b:hi_insideStringNames, s) + endfor + endif + + " Syntax names indicating being inside a tag. + let tag_names = [] + if exists("b:html_indent_tag_names") + let tag_names = b:html_indent_tag_names + elseif exists("g:html_indent_tag_names") + let tag_names = g:html_indent_tag_names + endif + let b:hi_insideTagNames = ['htmlTag', 'htmlScriptTag'] + if len(tag_names) > 0 + for s in tag_names + call add(b:hi_insideTagNames, s) + endfor + endif + + let indone = {"zero": 0 + \,"auto": "indent(prevnonblank(v:lnum-1))" + \,"inc": "b:hi_indent.blocktagind + shiftwidth()"} + + let script1 = '' + if exists("b:html_indent_script1") + let script1 = b:html_indent_script1 + elseif exists("g:html_indent_script1") + let script1 = g:html_indent_script1 + endif + if len(script1) > 0 + let b:hi_js1indent = get(indone, script1, indone.zero) + else + let b:hi_js1indent = 0 + endif + + let style1 = '' + if exists("b:html_indent_style1") + let style1 = b:html_indent_style1 + elseif exists("g:html_indent_style1") + let style1 = g:html_indent_style1 + endif + if len(style1) > 0 + let b:hi_css1indent = get(indone, style1, indone.zero) + else + let b:hi_css1indent = 0 + endif + + if !exists('b:html_indent_line_limit') + if exists('g:html_indent_line_limit') + let b:html_indent_line_limit = g:html_indent_line_limit + else + let b:html_indent_line_limit = 200 endif + endif +endfunc "}}} + +" Init Script Vars +"{{{ +let b:hi_lasttick = 0 +let b:hi_newstate = {} +let s:countonly = 0 + "}}} + +" Fill the s:indent_tags dict with known tags. +" The key is "tagname" or "/tagname". {{{ +" The value is: +" 1 opening tag +" 2 "pre" +" 3 "script" +" 4 "style" +" 5 comment start +" 6 conditional comment start +" -1 closing tag +" -2 "/pre" +" -3 "/script" +" -4 "/style" +" -5 comment end +" -6 conditional comment end +let s:indent_tags = {} +let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index +"}}} + +" Add a list of tag names for a pair of <tag> </tag> to "tags". +func! s:AddITags(tags, taglist) + "{{{ + for itag in a:taglist + let a:tags[itag] = 1 + let a:tags['/' . itag] = -1 + endfor +endfunc "}}} + +" Take a list of tag name pairs that are not to be used as tag pairs. +func! s:RemoveITags(tags, taglist) + "{{{ + for itag in a:taglist + let a:tags[itag] = 1 + let a:tags['/' . itag] = 1 + endfor +endfunc "}}} + +" Add a block tag, that is a tag with a different kind of indenting. +func! s:AddBlockTag(tag, id, ...) + "{{{ + if !(a:id >= 2 && a:id < len(s:endtags)) + echoerr 'AddBlockTag ' . a:id + return + endif + let s:indent_tags[a:tag] = a:id + if a:0 == 0 + let s:indent_tags['/' . a:tag] = -a:id + let s:endtags[a:id] = "</" . a:tag . ">" + else + let s:indent_tags[a:1] = -a:id + let s:endtags[a:id] = a:1 + endif +endfunc "}}} + +" Add known tag pairs. +" Self-closing tags and tags that are sometimes {{{ +" self-closing (e.g., <p>) are not here (when encountering </p> we can find +" the matching <p>, but not the other way around). +" Old HTML tags: +call s:AddITags(s:indent_tags, [ + \ 'a', 'abbr', 'acronym', 'address', 'b', 'bdo', 'big', + \ 'blockquote', 'body', 'button', 'caption', 'center', 'cite', 'code', + \ 'colgroup', 'del', 'dfn', 'dir', 'div', 'dl', 'em', 'fieldset', 'font', + \ 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'html', + \ 'i', 'iframe', 'ins', 'kbd', 'label', 'legend', 'li', + \ 'map', 'menu', 'noframes', 'noscript', 'object', 'ol', + \ 'optgroup', 'p', 'q', 's', 'samp', 'select', 'small', 'span', 'strong', 'sub', + \ 'sup', 'table', 'textarea', 'title', 'tt', 'u', 'ul', 'var', 'th', 'td', + \ 'tr', 'tbody', 'tfoot', 'thead']) + +" New HTML5 elements: +call s:AddITags(s:indent_tags, [ + \ 'area', 'article', 'aside', 'audio', 'bdi', 'canvas', + \ 'command', 'data', 'datalist', 'details', 'dislog', 'embed', 'figcaption', + \ 'figure', 'footer', 'header', 'keygen', 'main', 'mark', 'meter', 'nav', 'output', + \ 'picture', 'progress', 'rp', 'rt', 'ruby', 'section', 'source', 'summary', 'svg', + \ 'time', 'track', 'video', 'wbr']) + +" Tags added for web components: +call s:AddITags(s:indent_tags, [ + \ 'content', 'shadow', 'template']) +"}}} + +" Add Block Tags: these contain alien content +"{{{ +call s:AddBlockTag('pre', 2) +call s:AddBlockTag('script', 3) +call s:AddBlockTag('style', 4) +call s:AddBlockTag('<!--', 5, '-->') +call s:AddBlockTag('<!--[', 6, '![endif]-->') +"}}} + +" Return non-zero when "tagname" is an opening tag, not being a block tag, for +" which there should be a closing tag. Can be used by scripts that include +" HTML indenting. +func! HtmlIndent_IsOpenTag(tagname) + "{{{ + if get(s:indent_tags, a:tagname) == 1 + return 1 + endif + return get(b:hi_tags, a:tagname) == 1 +endfunc "}}} + +" Get the value for "tagname", taking care of buffer-local tags. +func! s:get_tag(tagname) + "{{{ + let i = get(s:indent_tags, a:tagname) + if (i == 1 || i == -1) && get(b:hi_removed_tags, a:tagname) != 0 return 0 -endfun + endif + if i == 0 + let i = get(b:hi_tags, a:tagname) + endif + return i +endfunc "}}} -fun! HtmlIndentGet(lnum) - " Get shiftwidth value. - if exists('*shiftwidth') - let sw = shiftwidth() +" Count the number of start and end tags in "text". +func! s:CountITags(text) + "{{{ + " Store the result in s:curind and s:nextrel. + let s:curind = 0 " relative indent steps for current line [unit &sw]: + let s:nextrel = 0 " relative indent steps for next line [unit &sw]: + let s:block = 0 " assume starting outside of a block + let s:countonly = 1 " don't change state + call substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g') + let s:countonly = 0 +endfunc "}}} + +" Count the number of start and end tags in text. +func! s:CountTagsAndState(text) + "{{{ + " Store the result in s:curind and s:nextrel. Update b:hi_newstate.block. + let s:curind = 0 " relative indent steps for current line [unit &sw]: + let s:nextrel = 0 " relative indent steps for next line [unit &sw]: + + let s:block = b:hi_newstate.block + let tmp = substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g') + if s:block == 3 + let b:hi_newstate.scripttype = s:GetScriptType(matchstr(tmp, '\C.*<SCRIPT\>\zs[^>]*')) + endif + let b:hi_newstate.block = s:block +endfunc "}}} + +" Used by s:CountITags() and s:CountTagsAndState(). +func! s:CheckTag(itag) + "{{{ + " Returns an empty string or "SCRIPT". + " a:itag can be "tag" or "/tag" or "<!--" or "-->" + if (s:CheckCustomTag(a:itag)) + return "" + endif + let ind = s:get_tag(a:itag) + if ind == -1 + " closing tag + if s:block != 0 + " ignore itag within a block + return "" + endif + if s:nextrel == 0 + let s:curind -= 1 else - let sw = &sw + let s:nextrel -= 1 endif + elseif ind == 1 + " opening tag + if s:block != 0 + return "" + endif + let s:nextrel += 1 + elseif ind != 0 + " block-tag (opening or closing) + return s:CheckBlockTag(a:itag, ind) + " else ind==0 (other tag found): keep indent + endif + return "" +endfunc "}}} - " Find a non-empty line above the current line. - let lnum = prevnonblank(a:lnum - 1) +" Used by s:CheckTag(). Returns an empty string or "SCRIPT". +func! s:CheckBlockTag(blocktag, ind) + "{{{ + if a:ind > 0 + " a block starts here + if s:block != 0 + " already in a block (nesting) - ignore + " especially ignore comments after other blocktags + return "" + endif + let s:block = a:ind " block type + if s:countonly + return "" + endif + let b:hi_newstate.blocklnr = v:lnum + " save allover indent for the endtag + let b:hi_newstate.blocktagind = b:hi_indent.baseindent + (s:nextrel + s:curind) * shiftwidth() + if a:ind == 3 + return "SCRIPT" " all except this must be lowercase + " line is to be checked again for the type attribute + endif + else + let s:block = 0 + " we get here if starting and closing a block-tag on the same line + endif + return "" +endfunc "}}} - " Hit the start of the file, use zero indent. - if lnum == 0 - return 0 +" Used by s:CheckTag(). +func! s:CheckCustomTag(ctag) + "{{{ + " Returns 1 if ctag is the tag for a custom element, 0 otherwise. + " a:ctag can be "tag" or "/tag" or "<!--" or "-->" + let pattern = '\%\(\w\+-\)\+\w\+' + if match(a:ctag, pattern) == -1 + return 0 + endif + if matchstr(a:ctag, '\/\ze.\+') == "/" + " closing tag + if s:block != 0 + " ignore ctag within a block + return 1 + endif + if s:nextrel == 0 + let s:curind -= 1 + else + let s:nextrel -= 1 endif + else + " opening tag + if s:block != 0 + return 1 + endif + let s:nextrel += 1 + endif + return 1 +endfunc "}}} - let restore_ic = &ic - setlocal ic " ignore case +" Return the <script> type: either "javascript" or "" +func! s:GetScriptType(str) + "{{{ + if a:str == "" || a:str =~ "java" + return "javascript" + else + return "" + endif +endfunc "}}} - " [-- special handling for <pre>: no indenting --] - if getline(a:lnum) =~ '\c</pre>' - \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb') - \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW') - " we're in a line with </pre> or inside <pre> ... </pre> - if restore_ic == 0 - setlocal noic - endif - return -1 +" Look back in the file, starting at a:lnum - 1, to compute a state for the +" start of line a:lnum. Return the new state. +func! s:FreshState(lnum) + "{{{ + " A state is to know ALL relevant details about the + " lines 1..a:lnum-1, initial calculating (here!) can be slow, but updating is + " fast (incremental). + " TODO: this should be split up in detecting the block type and computing the + " indent for the block type, so that when we do not know the indent we do + " not need to clear the whole state and re-detect the block type again. + " State: + " lnum last indented line == prevnonblank(a:lnum - 1) + " block = 0 a:lnum located within special tag: 0:none, 2:<pre>, + " 3:<script>, 4:<style>, 5:<!--, 6:<!--[ + " baseindent use this indent for line a:lnum as a start - kind of + " autoindent (if block==0) + " scripttype = '' type attribute of a script tag (if block==3) + " blocktagind indent for current opening (get) and closing (set) + " blocktag (if block!=0) + " blocklnr lnum of starting blocktag (if block!=0) + " inattr line {lnum} starts with attributes of a tag + let state = {} + let state.lnum = prevnonblank(a:lnum - 1) + let state.scripttype = "" + let state.blocktagind = -1 + let state.block = 0 + let state.baseindent = 0 + let state.blocklnr = 0 + let state.inattr = 0 + + if state.lnum == 0 + return state + endif + + " Heuristic: + " remember startline state.lnum + " look back for <pre, </pre, <script, </script, <style, </style tags + " remember stopline + " if opening tag found, + " assume a:lnum within block + " else + " look back in result range (stopline, startline) for comment + " \ delimiters (<!--, -->) + " if comment opener found, + " assume a:lnum within comment + " else + " assume usual html for a:lnum + " if a:lnum-1 has a closing comment + " look back to get indent of comment opener + " FI + + " look back for a blocktag + let stopline2 = v:lnum + 1 + if has_key(b:hi_indent, 'block') && b:hi_indent.block > 5 + let [stopline2, stopcol2] = searchpos('<!--', 'bnW') + endif + let [stopline, stopcol] = searchpos('\c<\zs\/\=\%(pre\>\|script\>\|style\>\)', "bnW") + if stopline > 0 && stopline < stopline2 + " ugly ... why isn't there searchstr() + let tagline = tolower(getline(stopline)) + let blocktag = matchstr(tagline, '\/\=\%(pre\>\|script\>\|style\>\)', stopcol - 1) + if blocktag[0] != "/" + " opening tag found, assume a:lnum within block + let state.block = s:indent_tags[blocktag] + if state.block == 3 + let state.scripttype = s:GetScriptType(matchstr(tagline, '\>[^>]*', stopcol)) + endif + let state.blocklnr = stopline + " check preceding tags in the line: + call s:CountITags(tagline[: stopcol-2]) + let state.blocktagind = indent(stopline) + (s:curind + s:nextrel) * shiftwidth() + return state + elseif stopline == state.lnum + " handle special case: previous line (= state.lnum) contains a + " closing blocktag which is preceded by line-noise; + " blocktag == "/..." + let swendtag = match(tagline, '^\s*</') >= 0 + if !swendtag + let [bline, bcol] = searchpos('<'.blocktag[1:].'\>', "bnW") + call s:CountITags(tolower(getline(bline)[: bcol-2])) + let state.baseindent = indent(bline) + (s:curind + s:nextrel) * shiftwidth() + return state + endif endif + endif + if stopline > stopline2 + let stopline = stopline2 + let stopcol = stopcol2 + endif - " [-- special handling for <javascript>: use cindent --] - let js = '<script' - let jse = '</script>' - - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - " by Tye Zdrojewski <zdro@yahoo.com>, 05 Jun 2006 - " ZDR: This needs to be an AND (we are 'after the start of the pair' AND - " we are 'before the end of the pair'). Otherwise, indentation - " before the start of the script block will be affected; the end of - " the pair will still match if we are before the beginning of the - " pair. - " - if 0 < searchpair(js, '', jse, 'nWb') - \ && 0 < searchpair(js, '', jse, 'nW') - " we're inside javascript - if getline(searchpair(js, '', '</script>', 'nWb')) !~ '<script [^>]*type=["'']\?text\/\(html\|\(ng-\)\?template\)' - \ && getline(lnum) !~ js && getline(a:lnum) !~ jse - if restore_ic == 0 - setlocal noic - endif - if s:jsindent == '' - return cindent(a:lnum) - else - execute 'let ind = ' . s:jsindent - return ind - endif - endif - if getline(a:lnum) =~ jse - return indent(searchpair(js, '', jse, 'nWb')) - endif + " else look back for comment + let [comlnum, comcol, found] = searchpos('\(<!--\[\)\|\(<!--\)\|-->', 'bpnW', stopline) + if found == 2 || found == 3 + " comment opener found, assume a:lnum within comment + let state.block = (found == 3 ? 5 : 6) + let state.blocklnr = comlnum + " check preceding tags in the line: + call s:CountITags(tolower(getline(comlnum)[: comcol-2])) + if found == 2 + let state.baseindent = b:hi_indent.baseindent endif + let state.blocktagind = indent(comlnum) + (s:curind + s:nextrel) * shiftwidth() + return state + endif - let css = '<style' - let csse = '</style>' - if 0 < searchpair(css, '', csse, 'nWb') - \ && 0 < searchpair(css, '', csse, 'nW') - " we're inside style - if getline(lnum) !~ css && getline(a:lnum) !~ csse - if restore_ic == 0 - setlocal noic - endif - if s:cssindent == '' - return cindent(a:lnum) - else - execute 'let ind = ' . s:cssindent - return ind - endif - endif - if getline(a:lnum) =~ csse - return indent(searchpair(css, '', csse, 'nWb')) + " else within usual HTML + let text = tolower(getline(state.lnum)) + + " Check a:lnum-1 for closing comment (we need indent from the opening line). + " Not when other tags follow (might be --> inside a string). + let comcol = stridx(text, '-->') + if comcol >= 0 && match(text, '[<>]', comcol) <= 0 + call cursor(state.lnum, comcol + 1) + let [comlnum, comcol] = searchpos('<!--', 'bW') + if comlnum == state.lnum + let text = text[: comcol-2] + else + let text = tolower(getline(comlnum)[: comcol-2]) + endif + call s:CountITags(text) + let state.baseindent = indent(comlnum) + (s:curind + s:nextrel) * shiftwidth() + " TODO check tags that follow "-->" + return state + endif + + " Check if the previous line starts with end tag. + let swendtag = match(text, '^\s*</') >= 0 + + " If previous line ended in a closing tag, line up with the opening tag. + if !swendtag && text =~ '</\w\+\s*>\s*$' + call cursor(state.lnum, 99999) + normal! F< + let start_lnum = HtmlIndent_FindStartTag() + if start_lnum > 0 + let state.baseindent = indent(start_lnum) + if col('.') > 2 + " check for tags before the matching opening tag. + let text = getline(start_lnum) + let swendtag = match(text, '^\s*</') >= 0 + call s:CountITags(text[: col('.') - 2]) + let state.baseindent += s:nextrel * shiftwidth() + if !swendtag + let state.baseindent += s:curind * shiftwidth() endif + endif + return state endif + endif + + " Else: no comments. Skip backwards to find the tag we're inside. + let [state.lnum, found] = HtmlIndent_FindTagStart(state.lnum) + " Check if that line starts with end tag. + let text = getline(state.lnum) + let swendtag = match(text, '^\s*</') >= 0 + call s:CountITags(tolower(text)) + let state.baseindent = indent(state.lnum) + s:nextrel * shiftwidth() + if !swendtag + let state.baseindent += s:curind * shiftwidth() + endif + return state +endfunc "}}} - if getline(lnum) =~ '\c</pre>' - " line before the current line a:lnum contains - " a closing </pre>. --> search for line before - " starting <pre> to restore the indent. - let preline = prevnonblank(search('\c<pre>', 'bW') - 1) - if preline > 0 - if restore_ic == 0 - setlocal noic - endif - - if 0 == match(getline(a:lnum), '^\s*</') - return indent(preline) - (1*sw) - else - return indent(preline) - endif +" Indent inside a <pre> block: Keep indent as-is. +func! s:Alien2() + "{{{ + return -1 +endfunc "}}} + +" Return the indent inside a <script> block for javascript. +func! s:Alien3() + "{{{ + let lnum = prevnonblank(v:lnum - 1) + while lnum > 1 && getline(lnum) =~ '^\s*/[/*]' + " Skip over comments to avoid that cindent() aligns with the <script> tag + let lnum = prevnonblank(lnum - 1) + endwhile + if lnum == b:hi_indent.blocklnr + " indent for the first line after <script> + return eval(b:hi_js1indent) + endif + if b:hi_indent.scripttype == "javascript" + return GetJavascriptIndent() + else + return -1 + endif +endfunc "}}} + +" Return the indent inside a <style> block. +func! s:Alien4() + "{{{ + if prevnonblank(v:lnum-1) == b:hi_indent.blocklnr + " indent for first content line + return eval(b:hi_css1indent) + endif + return s:CSSIndent() +endfunc "}}} + +" Indending inside a <style> block. Returns the indent. +func! s:CSSIndent() + "{{{ + " This handles standard CSS and also Closure stylesheets where special lines + " start with @. + " When the line starts with '*' or the previous line starts with "/*" + " and does not end in "*/", use C indenting to format the comment. + " Adopted $VIMRUNTIME/indent/css.vim + let curtext = getline(v:lnum) + if curtext =~ '^\s*[*]' + \ || (v:lnum > 1 && getline(v:lnum - 1) =~ '\s*/\*' + \ && getline(v:lnum - 1) !~ '\*/\s*$') + return cindent(v:lnum) + endif + + let min_lnum = b:hi_indent.blocklnr + let prev_lnum = s:CssPrevNonComment(v:lnum - 1, min_lnum) + let [prev_lnum, found] = HtmlIndent_FindTagStart(prev_lnum) + if prev_lnum <= min_lnum + " Just below the <style> tag, indent for first content line after comments. + return eval(b:hi_css1indent) + endif + + " If the current line starts with "}" align with it's match. + if curtext =~ '^\s*}' + call cursor(v:lnum, 1) + try + normal! % + " Found the matching "{", align with it after skipping unfinished lines. + let align_lnum = s:CssFirstUnfinished(line('.'), min_lnum) + return indent(align_lnum) + catch + " can't find it, try something else, but it's most likely going to be + " wrong + endtry + endif + + " add indent after { + let brace_counts = HtmlIndent_CountBraces(prev_lnum) + let extra = brace_counts.c_open * shiftwidth() + + let prev_text = getline(prev_lnum) + let below_end_brace = prev_text =~ '}\s*$' + + " Search back to align with the first line that's unfinished. + let align_lnum = s:CssFirstUnfinished(prev_lnum, min_lnum) + + " Handle continuation lines if aligning with previous line and not after a + " "}". + if extra == 0 && align_lnum == prev_lnum && !below_end_brace + let prev_hasfield = prev_text =~ '^\s*[a-zA-Z0-9-]\+:' + let prev_special = prev_text =~ '^\s*\(/\*\|@\)' + if curtext =~ '^\s*\(/\*\|@\)' + " if the current line is not a comment or starts with @ (used by template + " systems) reduce indent if previous line is a continuation line + if !prev_hasfield && !prev_special + let extra = -shiftwidth() + endif + else + let cur_hasfield = curtext =~ '^\s*[a-zA-Z0-9-]\+:' + let prev_unfinished = s:CssUnfinished(prev_text) + if !cur_hasfield && (prev_hasfield || prev_unfinished) + " Continuation line has extra indent if the previous line was not a + " continuation line. + let extra = shiftwidth() + " Align with @if + if prev_text =~ '^\s*@if ' + let extra = 4 endif + elseif cur_hasfield && !prev_hasfield && !prev_special + " less indent below a continuation line + let extra = -shiftwidth() + endif + endif + endif + + if below_end_brace + " find matching {, if that line starts with @ it's not the start of a rule + " but something else from a template system + call cursor(prev_lnum, 1) + call search('}\s*$') + try + normal! % + " Found the matching "{", align with it. + let align_lnum = s:CssFirstUnfinished(line('.'), min_lnum) + let special = getline(align_lnum) =~ '^\s*@' + catch + let special = 0 + endtry + if special + " do not reduce indent below @{ ... } + if extra < 0 + let extra += shiftwidth() + endif + else + let extra -= (brace_counts.c_close - (prev_text =~ '^\s*}')) * shiftwidth() + endif + endif + + " if no extra indent yet... + if extra == 0 + if brace_counts.p_open > brace_counts.p_close + " previous line has more ( than ): add a shiftwidth + let extra = shiftwidth() + elseif brace_counts.p_open < brace_counts.p_close + " previous line has more ) than (: subtract a shiftwidth + let extra = -shiftwidth() endif + endif + + return indent(align_lnum) + extra +endfunc "}}} + +" Inside <style>: Whether a line is unfinished. +func! s:CssUnfinished(text) + "{{{ + return a:text =~ '\s\(||\|&&\|:\)\s*$' +endfunc "}}} + +" Search back for the first unfinished line above "lnum". +func! s:CssFirstUnfinished(lnum, min_lnum) + "{{{ + let align_lnum = a:lnum + while align_lnum > a:min_lnum && s:CssUnfinished(getline(align_lnum - 1)) + let align_lnum -= 1 + endwhile + return align_lnum +endfunc "}}} + +" Find the non-empty line at or before "lnum" that is not a comment. +func! s:CssPrevNonComment(lnum, stopline) + "{{{ + " caller starts from a line a:lnum + 1 that is not a comment + let lnum = prevnonblank(a:lnum) + while 1 + let ccol = match(getline(lnum), '\*/') + if ccol < 0 + " No comment end thus it's something else. + return lnum + endif + call cursor(lnum, ccol + 1) + " Search back for the /* that starts the comment + let lnum = search('/\*', 'bW', a:stopline) + if indent(".") == virtcol(".") - 1 + " The found /* is at the start of the line. Now go back to the line + " above it and again check if it is a comment. + let lnum = prevnonblank(lnum - 1) + else + " /* is after something else, thus it's not a comment line. + return lnum + endif + endwhile +endfunc "}}} + +" Check the number of {} and () in line "lnum". Return a dict with the counts. +func! HtmlIndent_CountBraces(lnum) + "{{{ + let brs = substitute(getline(a:lnum), '[''"].\{-}[''"]\|/\*.\{-}\*/\|/\*.*$\|[^{}()]', '', 'g') + let c_open = 0 + let c_close = 0 + let p_open = 0 + let p_close = 0 + for brace in split(brs, '\zs') + if brace == "{" + let c_open += 1 + elseif brace == "}" + if c_open > 0 + let c_open -= 1 + else + let c_close += 1 + endif + elseif brace == '(' + let p_open += 1 + elseif brace == ')' + if p_open > 0 + let p_open -= 1 + else + let p_close += 1 + endif + endif + endfor + return {'c_open': c_open, + \ 'c_close': c_close, + \ 'p_open': p_open, + \ 'p_close': p_close} +endfunc "}}} + +" Return the indent for a comment: <!-- --> +func! s:Alien5() + "{{{ + let curtext = getline(v:lnum) + if curtext =~ '^\s*\zs-->' + " current line starts with end of comment, line up with comment start. + call cursor(v:lnum, 0) + let lnum = search('<!--', 'b') + if lnum > 0 + " TODO: what if <!-- is not at the start of the line? + return indent(lnum) + endif + + " Strange, can't find it. + return -1 + endif + + let prevlnum = prevnonblank(v:lnum - 1) + let prevtext = getline(prevlnum) + let idx = match(prevtext, '^\s*\zs<!--') + if idx >= 0 + " just below comment start, add a shiftwidth + return idx + shiftwidth() + endif + + " Some files add 4 spaces just below a TODO line. It's difficult to detect + " the end of the TODO, so let's not do that. - let ind = <SID>HtmlIndentSum(lnum, -1) - let ind = ind + <SID>HtmlIndentSum(a:lnum, 0) + " Align with the previous non-blank line. + return indent(prevlnum) +endfunc "}}} - " Fix for conditional comment - if getline(a:lnum) =~ '\c<!--.*<\(html\|body\).*-->' - let ind = ind - 1 +" Return the indent for conditional comment: <!--[ ![endif]--> +func! s:Alien6() + "{{{ + let curtext = getline(v:lnum) + if curtext =~ '\s*\zs<!\[endif\]-->' + " current line starts with end of comment, line up with comment start. + let lnum = search('<!--', 'bn') + if lnum > 0 + return indent(lnum) endif + endif + return b:hi_indent.baseindent + shiftwidth() +endfunc "}}} - let lind = indent(lnum) - - " for tags in s:omittable - " let tags_exp = '<\(' . join(tags, '\|') . '\)>' - " let close_tags_exp = '</\(' . join(tags, '\|') . '\)>' - " if getline(a:lnum) =~ tags_exp - " let block_start = search('^'.repeat(' ', lind + (sw * ind - 1)).'\S' , 'bnW') - " let prev_tag = search(tags_exp, 'bW', block_start) - " let prev_closetag = search(close_tags_exp, 'W', a:lnum) - " if prev_tag && !prev_closetag - " let ind = ind - 1 - " endif - " endif - - " if getline(a:lnum) =~ '</\w\+>' - " let block_start = search('^'.repeat(' ', lind + (sw * ind - 1)).'\S' , 'bnW') - " let prev_tag = search(tags_exp, 'bW', block_start) - " let prev_closetag = search(close_tags_exp, 'W', a:lnum) - " if prev_tag && !prev_closetag - " let ind = ind - 1 - " endif - " endif - " endfor - - if restore_ic == 0 - setlocal noic +" When the "lnum" line ends in ">" find the line containing the matching "<". +func! HtmlIndent_FindTagStart(lnum) + "{{{ + " Avoids using the indent of a continuation line. + " Moves the cursor. + " Return two values: + " - the matching line number or "lnum". + " - a flag indicating whether we found the end of a tag. + " This method is global so that HTML-like indenters can use it. + " To avoid matching " > " or " < " inside a string require that the opening + " "<" is followed by a word character and the closing ">" comes after a + " non-white character. + let idx = match(getline(a:lnum), '\S>\s*$') + if idx > 0 + call cursor(a:lnum, idx) + let lnum = searchpair('<\w', '' , '\S>', 'bW', '', max([a:lnum - b:html_indent_line_limit, 0])) + if lnum > 0 + return [lnum, 1] endif + endif + return [a:lnum, 0] +endfunc "}}} + +" Find the unclosed start tag from the current cursor position. +func! HtmlIndent_FindStartTag() + "{{{ + " The cursor must be on or before a closing tag. + " If found, positions the cursor at the match and returns the line number. + " Otherwise returns 0. + let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs\w\+\(-\w\+\)*\ze') + let start_lnum = searchpair('<' . tagname . '\>', '', '</' . tagname . '\>', 'bW') + if start_lnum > 0 + return start_lnum + endif + return 0 +endfunc "}}} + +" Moves the cursor from a "<" to the matching ">". +func! HtmlIndent_FindTagEnd() + "{{{ + " Call this with the cursor on the "<" of a start tag. + " This will move the cursor to the ">" of the matching end tag or, when it's + " a self-closing tag, to the matching ">". + " Limited to look up to b:html_indent_line_limit lines away. + let text = getline('.') + let tagname = matchstr(text, '\w\+\(-\w\+\)*\|!--', col('.')) + if tagname == '!--' + call search('--\zs>') + elseif s:get_tag('/' . tagname) != 0 + " tag with a closing tag, find matching "</tag>" + call searchpair('<' . tagname, '', '</' . tagname . '\zs>', 'W', '', line('.') + b:html_indent_line_limit) + else + " self-closing tag, find the ">" + call search('\S\zs>') + endif +endfunc "}}} + +" Indenting inside a start tag. Return the correct indent or -1 if unknown. +func! s:InsideTag(foundHtmlString) + "{{{ + if a:foundHtmlString + " Inside an attribute string. + " Align with the previous line or use an external function. + let lnum = v:lnum - 1 + if lnum > 1 + if exists('b:html_indent_tag_string_func') + return b:html_indent_tag_string_func(lnum) + endif + return indent(lnum) + endif + endif + + " Should be another attribute: " attr="val". Align with the previous + " attribute start. + let lnum = v:lnum + while lnum > 1 + let lnum -= 1 + let text = getline(lnum) + " Find a match with one of these, align with "attr": + " attr= + " <tag attr= + " text<tag attr= + " <tag>text</tag>text<tag attr= + " For long lines search for the first match, finding the last match + " gets very slow. + if len(text) < 300 + let idx = match(text, '.*\s\zs[_a-zA-Z0-9-]\+="') + else + let idx = match(text, '\s\zs[_a-zA-Z0-9-]\+="') + endif + if idx == -1 + let idx = match(text, '<\w\+\(-\w\+\)*\s\zs\w') + endif + if idx == -1 + let idx = match(text, '<\w\+\(-\w\+\)*') + if idx >= 0 + let idx = idx + shiftwidth() + endif + endif + if idx > 0 + " Found the attribute. TODO: assumes spaces, no Tabs. + return idx + endif + endwhile + return -1 +endfunc "}}} + +" THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum. +func! HtmlIndent() + "{{{ + if prevnonblank(v:lnum - 1) < 1 + " First non-blank line has no indent. + return 0 + endif + + let curtext = tolower(getline(v:lnum)) + let indentunit = shiftwidth() + + let b:hi_newstate = {} + let b:hi_newstate.lnum = v:lnum + + " When syntax HL is enabled, detect we are inside a tag. Indenting inside + " a tag works very differently. Do not do this when the line starts with + " "<", it gets the "htmlTag" ID but we are not inside a tag then. + if curtext !~ '^\s*<' + normal! ^ + let stack = synstack(v:lnum, col('.')) " assumes there are no tabs + let foundHtmlString = 0 + for synid in reverse(stack) + let name = synIDattr(synid, "name") + if index(b:hi_insideStringNames, name) >= 0 + let foundHtmlString = 1 + elseif index(b:hi_insideTagNames, name) >= 0 + " Yes, we are inside a tag. + let indent = s:InsideTag(foundHtmlString) + if indent >= 0 + " Do not keep the state. TODO: could keep the block type. + let b:hi_indent.lnum = 0 + return indent + endif + endif + endfor + endif + + " does the line start with a closing tag? + let swendtag = match(curtext, '^\s*</') >= 0 + + if prevnonblank(v:lnum - 1) == b:hi_indent.lnum && b:hi_lasttick == b:changedtick - 1 + " use state (continue from previous line) + else + " start over (know nothing) + let b:hi_indent = s:FreshState(v:lnum) + endif + + if b:hi_indent.block >= 2 + " within block + let endtag = s:endtags[b:hi_indent.block] + let blockend = stridx(curtext, endtag) + if blockend >= 0 + " block ends here + let b:hi_newstate.block = 0 + " calc indent for REST OF LINE (may start more blocks): + call s:CountTagsAndState(strpart(curtext, blockend + strlen(endtag))) + if swendtag && b:hi_indent.block != 5 + let indent = b:hi_indent.blocktagind + s:curind * indentunit + let b:hi_newstate.baseindent = indent + s:nextrel * indentunit + else + let indent = s:Alien{b:hi_indent.block}() + let b:hi_newstate.baseindent = b:hi_indent.blocktagind + s:nextrel * indentunit + endif + else + " block continues + " indent this line with alien method + let indent = s:Alien{b:hi_indent.block}() + endif + else + " not within a block - within usual html + let b:hi_newstate.block = b:hi_indent.block + if swendtag + " The current line starts with an end tag, align with its start tag. + call cursor(v:lnum, 1) + let start_lnum = HtmlIndent_FindStartTag() + if start_lnum > 0 + " check for the line starting with something inside a tag: + " <sometag <- align here + " attr=val><open> not here + let text = getline(start_lnum) + let angle = matchstr(text, '[<>]') + if angle == '>' + call cursor(start_lnum, 1) + normal! f>% + let start_lnum = line('.') + let text = getline(start_lnum) + endif + + let indent = indent(start_lnum) + if col('.') > 2 + let swendtag = match(text, '^\s*</') >= 0 + call s:CountITags(text[: col('.') - 2]) + let indent += s:nextrel * shiftwidth() + if !swendtag + let indent += s:curind * shiftwidth() + endif + endif + else + " not sure what to do + let indent = b:hi_indent.baseindent + endif + let b:hi_newstate.baseindent = indent + else + call s:CountTagsAndState(curtext) + let indent = b:hi_indent.baseindent + let b:hi_newstate.baseindent = indent + (s:curind + s:nextrel) * indentunit + endif + endif + + let b:hi_lasttick = b:changedtick + call extend(b:hi_indent, b:hi_newstate, "force") + return indent +endfunc "}}} - return lind + (sw * ind) -endfun +" Check user settings when loading this script the first time. +call HtmlIndent_CheckUserSettings() let &cpo = s:cpo_save unlet s:cpo_save -" [-- EOF <runtime>/indent/html.vim --] +" vim: fdm=marker ts=8 sw=2 tw=78 endif diff --git a/indent/javascript.vim b/indent/javascript.vim index a31268d2..f50fbc82 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -89,22 +89,22 @@ function s:SynAt(l,c) endfunction function s:ParseCino(f) - let [divider, n, cstr] = [0] + matchlist(&cino, - \ '\%(.*,\)\=\%(\%d'.char2nr(a:f).'\(-\)\=\([.s0-9]*\)\)\=')[1:2] - for c in split(cstr,'\zs') - if c == '.' && !divider + let [s, n, divider] = [strridx(&cino, a:f)+1, '', 0] + while s && &cino[ s ] =~ '[^,]' + if &cino[ s ] == '.' let divider = 1 - elseif c ==# 's' + elseif &cino[ s ] ==# 's' if n !~ '\d' return n . s:sw() + 0 endif let n = str2nr(n) * s:sw() break else - let [n, divider] .= [c, 0] + let [n, divider] .= [&cino[ s ], 0] endif - endfor - return str2nr(n) / max([str2nr(divider),1]) + let s += 1 + endwhile + return str2nr(n) / max([divider, 1]) endfunction " Optimized {skip} expr, only callable from the search loop which @@ -208,18 +208,15 @@ function s:ExprCol() let bal = 0 while s:SearchLoop('[{}?:]','bW',s:skip_expr) if s:LookingAt() == ':' - if getline('.')[col('.')-2] == ':' - call cursor(0,col('.')-1) - continue - endif - let bal -= 1 + let bal -= !search('\m:\%#','bW') elseif s:LookingAt() == '?' if getline('.')[col('.'):col('.')+1] =~ '^\.\d\@!' - continue + " ?. conditional chain, not ternary start elseif !bal return 1 + else + let bal += 1 endif - let bal += 1 elseif s:LookingAt() == '{' return !s:IsBlock() elseif !s:GetPair('{','}','bW',s:skip_expr) @@ -316,8 +313,8 @@ function s:IsContOne(cont) endfunction function s:IsSwitch() - return search('\m\C\%'.join(b:js_cache[1:],'l\%'). - \ 'c{\_s*\%(\%(\/\/.*\_$\|\/\*\_.\{-}\*\/\)\@>\_s*\)*\%(case\|default\)\>','nW'.s:z) + return search(printf('\m\C\%%%dl\%%%dc%s',b:js_cache[1],b:js_cache[2], + \ '{\_s*\%(\%(\/\/.*\_$\|\/\*\_.\{-}\*\/\)\@>\_s*\)*\%(case\|default\)\>'),'nW'.s:z) endfunction " https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader @@ -367,8 +364,8 @@ function GetJavascriptIndent() return -1 endif - let s:l1 = max([0,prevnonblank(v:lnum) - (s:rel ? 2000 : 1000), - \ get(get(b:,'hi_indent',{}),'blocklnr')]) + let nest = get(get(b:,'hi_indent',{}),'blocklnr') + let s:l1 = max([0, prevnonblank(v:lnum) - (s:rel ? 2000 : 1000), nest]) call cursor(v:lnum,1) if s:PreviousToken() is '' return @@ -376,7 +373,7 @@ function GetJavascriptIndent() let [l:lnum, lcol, pline] = getpos('.')[1:2] + [getline('.')[:col('.')-1]] let l:line = substitute(l:line,'^\s*','','') - let l:line_raw = l:line + let l:line_s = l:line[0] if l:line[:1] == '/*' let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','') endif @@ -450,7 +447,7 @@ function GetJavascriptIndent() let pval = s:ParseCino('(') if !pval let [Wval, vcol] = [s:ParseCino('W'), virtcol('.')] - if search('\m\S','W',num) + if search('\m'.get(g:,'javascript_indent_W_pat','\S'),'W',num) return s:ParseCino('w') ? vcol : virtcol('.')-1 endif return Wval ? s:Nat(num_ind + Wval) : vcol @@ -460,7 +457,7 @@ function GetJavascriptIndent() " main return if l:line =~ '^[])}]\|^|}' - if l:line_raw[0] == ')' + if l:line_s == ')' if s:ParseCino('M') return indent(l:lnum) elseif num && &cino =~# 'm' && !s:ParseCino('m') @@ -470,10 +467,8 @@ function GetJavascriptIndent() return num_ind elseif num return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op) - endif - let nest = get(get(b:,'hi_indent',{}),'blocklnr') - if nest - return indent(nest) + s:sw() + b_l + is_op + elseif nest + return indent(nextnonblank(nest+1)) + b_l + is_op endif return b_l + is_op endfunction diff --git a/indent/julia.vim b/indent/julia.vim index 4833d7e5..88e90e57 100644 --- a/indent/julia.vim +++ b/indent/julia.vim @@ -27,13 +27,13 @@ function JuliaMatch(lnum, str, regex, st, ...) let s = a:st let e = a:0 > 0 ? a:1 : -1 while 1 - let f = match(a:str, a:regex, s) + let f = match(a:str, '\C' . a:regex, s) if e >= 0 && f >= e return -1 endif if f >= 0 let attr = synIDattr(synID(a:lnum,f+1,1),"name") - if attr =~ s:skipPatterns + if attr =~# s:skipPatterns let s = f+1 continue endif @@ -84,7 +84,7 @@ function GetJuliaNestingStruct(lnum, ...) let i = JuliaMatch(a:lnum, line, '@\@<!\<else\>', s) if i >= 0 && i == fb let s = i+1 - if len(blocks_stack) > 0 && blocks_stack[-1] =~ '\<\%(else\)\=if\>' + if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(else\)\=if\>' let blocks_stack[-1] = 'else' else call add(blocks_stack, 'else') @@ -135,7 +135,7 @@ function GetJuliaNestingStruct(lnum, ...) let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(while\|for\|\%(staged\)\?function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(\%(abstract\|primitive\)\s\+\)\?type\|immutable\|let\|quote\|do\)\>', s) if i >= 0 && i == fb - if match(line, '\<\%(mutable\|abstract\|primitive\)', i) != -1 + if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1 let s = i+11 else let s = i+1 @@ -290,16 +290,11 @@ function LastBlockIndent(lnum) endfunction function GetJuliaIndent() - let s:save_ignorecase = &ignorecase - set noignorecase - " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) " At the start of the file use zero indent. if lnum == 0 - let &ignorecase = s:save_ignorecase - unlet s:save_ignorecase return 0 endif @@ -387,8 +382,6 @@ function GetJuliaIndent() let num_closed_blocks -= 1 endwhile - let &ignorecase = s:save_ignorecase - unlet s:save_ignorecase return ind endfunction diff --git a/indent/nix.vim b/indent/nix.vim index 679b224f..fd277dcc 100644 --- a/indent/nix.vim +++ b/indent/nix.vim @@ -33,6 +33,12 @@ function! GetNixIndent() return 0 endif + " Skip indentation for single line comments explicitly, in case a + " comment was just inserted (eg. visual block mode) + if getline(v:lnum) =~ '^\s*#' + return indent(v:lnum) + endif + if synIDattr(synID(v:lnum, 1, 1), "name") !~ s:skip_syntax let current_line = getline(v:lnum) let last_line = getline(lnum) @@ -63,7 +69,7 @@ function! GetNixIndent() let ind = indent(v:lnum) let bslnum = searchpair('''''', '', '''''', 'bnW', - \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "InterpolationSpecial$"') + \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "StringSpecial$"') if ind <= indent(bslnum) let ind = indent(bslnum) + &sw diff --git a/indent/swift.vim b/indent/swift.vim index 92df0fc8..14e851ee 100644 --- a/indent/swift.vim +++ b/indent/swift.vim @@ -42,11 +42,15 @@ endfunction function! s:IsExcludedFromIndentAtPosition(line, column) let name = s:SyntaxNameAtPosition(a:line, a:column) - return name ==# "swiftComment" || name ==# "swiftString" + return s:IsSyntaxNameExcludedFromIndent(name) endfunction function! s:IsExcludedFromIndent() - return s:SyntaxName() ==# "swiftComment" || s:SyntaxName() ==# "swiftString" + return s:IsSyntaxNameExcludedFromIndent(s:SyntaxName()) +endfunction + +function! s:IsSyntaxNameExcludedFromIndent(name) + return a:name ==# "swiftComment" || a:name ==# "swiftString" || a:name ==# "swiftInterpolatedWrapper" || a:name ==# "swiftMultilineInterpolatedWrapper" || a:name ==# "swiftMultilineString" endfunction function! s:IsCommentLine(lnum) @@ -103,10 +107,10 @@ function! SwiftIndent(...) return indent(openingSquare) + shiftwidth() endif - if line =~ ":$" + if line =~ ":$" && (line =~ '^\s*case\W' || line =~ '^\s*default\W') let switch = search("switch", "bWn") return indent(switch) - elseif previous =~ ":$" + elseif previous =~ ":$" && (previous =~ '^\s*case\W' || previous =~ '^\s*default\W') return previousIndent + shiftwidth() endif @@ -133,12 +137,26 @@ function! SwiftIndent(...) return previousIndent + shiftwidth() elseif line =~ "}.*{" let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()") + + let bracketLine = getline(openingBracket) + let numOpenParensBracketLine = s:NumberOfMatches("(", bracketLine, openingBracket) + let numCloseParensBracketLine = s:NumberOfMatches(")", bracketLine, openingBracket) + if numOpenParensBracketLine > numCloseParensBracketLine + let line = line(".") + let column = col(".") + call cursor(openingParen, column) + let openingParenCol = searchpairpos("(", "", ")", "bWn", "s:IsExcludedFromIndent()")[1] + call cursor(line, column) + return openingParenCol + endif + return indent(openingBracket) elseif currentCloseBrackets > currentOpenBrackets let column = col(".") - call cursor(line("."), 1) + let line = line(".") + call cursor(line, 1) let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()") - call cursor(line("."), column) + call cursor(line, column) let bracketLine = getline(openingBracket) @@ -151,8 +169,23 @@ function! SwiftIndent(...) let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()") call cursor(line, column) return indent(openingParen) + elseif numOpenParensBracketLine > numCloseParensBracketLine + let line = line(".") + let column = col(".") + call cursor(openingParen, column) + let openingParenCol = searchpairpos("(", "", ")", "bWn", "s:IsExcludedFromIndent()")[1] + call cursor(line, column) + return openingParenCol endif + return indent(openingBracket) + elseif line =~ '^\s*)$' + let line = line(".") + let column = col(".") + call cursor(line, 1) + let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()") + call cursor(line, column) + return indent(openingParen) else " - Current line is blank, and the user presses 'o' return previousIndent @@ -196,8 +229,19 @@ function! SwiftIndent(...) return previousIndent + shiftwidth() endif - let previousParen = match(previous, "(") - return indent(previousParen) + shiftwidth() + let previousParen = match(previous, '\v\($') + if previousParen != -1 + return previousIndent + shiftwidth() + endif + + let line = line(".") + let column = col(".") + call cursor(previousNum, col([previousNum, "$"])) + let previousParen = searchpairpos("(", "", ")", "cbWn", "s:IsExcludedFromIndent()") + call cursor(line, column) + + " Match the last non escaped paren on the previous line + return previousParen[1] endif if numOpenBrackets > numCloseBrackets @@ -206,7 +250,7 @@ function! SwiftIndent(...) call cursor(previousNum, column) let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()") call cursor(line, column) - return indent(openingParen) + shiftwidth() + return openingParen + 1 endif " - Previous line has close then open braces, indent previous + 1 'sw' @@ -226,11 +270,23 @@ function! SwiftIndent(...) " - Line above has (unmatched) open paren, next line needs indent if numOpenParens > 0 let savePosition = getcurpos() + let lastColumnOfPreviousLine = col([previousNum, "$"]) - 1 " Must be at EOL because open paren has to be above (left of) the cursor - call cursor(previousNum, [previousNum, col("$")]) - let previousParen = searchpair("(", "", ")", "cbWn", "s:IsExcludedFromIndent()") + call cursor(previousNum, lastColumnOfPreviousLine) + let previousParen = searchpairpos("(", "", ")", "cbWn", "s:IsExcludedFromIndent()")[1] + " If the paren on the last line is the last character, indent the contents + " at shiftwidth + previous indent + if previousParen == lastColumnOfPreviousLine + return previousIndent + shiftwidth() + endif + + " The previous line opens a closure and doesn't close it + if numOpenBrackets > numCloseBrackets + return previousParen + shiftwidth() + endif + call setpos(".", savePosition) - return indent(previousParen) + shiftwidth() + return previousParen endif return cindent diff --git a/syntax/Jenkinsfile.vim b/syntax/Jenkinsfile.vim index 6639b862..efd00a41 100644 --- a/syntax/Jenkinsfile.vim +++ b/syntax/Jenkinsfile.vim @@ -3,24 +3,125 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1 runtime syntax/groovy.vim syn keyword jenkinsfileBuiltInVariable currentBuild +syn keyword jenkinsfileSection pipeline agent stages steps + +syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when + +syn keyword jenkinsfileOption contained buildDiscarder disableConcurrentBuilds overrideIndexTriggers skipDefaultCheckout nextgroup=jenkinsfileOptionParams +syn keyword jenkinsfileOption contained skipStagesAfterUnstable checkoutToSubdirectory timeout retry timestamps nextgroup=jenkinsfileOptionParams +syn region jenkinsfileOptionParams contained start="(" end=")" transparent contains=@groovyTop +syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1 + syn keyword jenkinsfileCoreStep checkout +syn keyword jenkinsfileCoreStep docker skipwhite nextgroup=jenkinsFileDockerConfigBlock syn keyword jenkinsfileCoreStep node syn keyword jenkinsfileCoreStep scm syn keyword jenkinsfileCoreStep sh syn keyword jenkinsfileCoreStep stage +syn keyword jenkinsfileCoreStep parallel +syn keyword jenkinsfileCoreStep steps syn keyword jenkinsfileCoreStep step syn keyword jenkinsfileCoreStep tool -syn keyword jenkinsfilePluginStep docker -syn keyword jenkinsfilePluginStep emailext -syn keyword jenkinsfilePluginStep exwsAllocate -syn keyword jenkinsfilePluginStep exws -syn keyword jenkinsfilePluginStep httpRequest -syn keyword jenkinsfilePluginStep junit +" TODO: These should probably be broken out. +syn keyword jenkinsfileCoreStep post always changed failure success unstable aborted + +syn region jenkinsFileDockerConfigBlock contained start="{" end="}" contains=groovyString,jenkinsfileDockerKeyword transparent +syn keyword jenkinsFileDockerKeyword contained image args dockerfile additionalBuildArgs + +syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber +syn keyword jenkinsfilePipelineStep ViolationsToBitbucketServer ViolationsToGitHub ViolationsToGitLab _OcAction _OcContextInit +syn keyword jenkinsfilePipelineStep _OcWatch acceptGitLabMR acsDeploy activateDTConfiguration addBadge addErrorBadge +syn keyword jenkinsfilePipelineStep addGitLabMRComment addInfoBadge addInteractivePromotion addShortText addWarningBadge +syn keyword jenkinsfilePipelineStep allure anchore androidApkMove androidApkUpload androidLint ansiColor ansiblePlaybook +syn keyword jenkinsfilePipelineStep ansibleTower ansibleVault appMonBuildEnvironment appMonPublishTestResults appMonRegisterTestRun +syn keyword jenkinsfilePipelineStep applatix approveReceivedEvent approveRequestedEvent aqua archive archiveArtifacts +syn keyword jenkinsfilePipelineStep arestocats artifactResolver artifactoryDistributeBuild artifactoryDownload artifactoryMavenBuild +syn keyword jenkinsfilePipelineStep artifactoryPromoteBuild artifactoryUpload awaitDeployment awaitDeploymentCompletion +syn keyword jenkinsfilePipelineStep awsCodeBuild awsIdentity azureCLI azureDownload azureFunctionAppPublish azureUpload +syn keyword jenkinsfilePipelineStep azureVMSSUpdate azureVMSSUpdateInstances azureWebAppPublish backlogPullRequest bat +syn keyword jenkinsfilePipelineStep bearychatSend benchmark bitbucketStatusNotify blazeMeterTest build buildBamboo buildImage +syn keyword jenkinsfilePipelineStep bzt cache catchError cbt cbtScreenshotsTest cbtSeleniumTest cfInvalidate cfnCreateChangeSet +syn keyword jenkinsfilePipelineStep cfnDelete cfnDeleteStackSet cfnDescribe cfnExecuteChangeSet cfnExports cfnUpdate +syn keyword jenkinsfilePipelineStep cfnUpdateStackSet cfnValidate changeAsmVer checkstyle chefSinatraStep cifsPublisher +syn keyword jenkinsfilePipelineStep cleanWs cleanup cloudshareDockerMachine cm cmake cmakeBuild cobertura codefreshLaunch +syn keyword jenkinsfilePipelineStep codefreshRun codescene codesonar collectEnv conanAddRemote conanAddUser configFileProvider +syn keyword jenkinsfilePipelineStep container containerLog contrastAgent contrastVerification copy copyArtifacts coverityResults +syn keyword jenkinsfilePipelineStep cpack createDeploymentEvent createEnvironment createEvent createMemoryDump createSummary +syn keyword jenkinsfilePipelineStep createThreadDump crxBuild crxDeploy crxDownload crxReplicate crxValidate ctest ctmInitiatePipeline +syn keyword jenkinsfilePipelineStep ctmPostPiData ctmSetPiData cucumber cucumberSlackSend currentNamespace debianPbuilder +syn keyword jenkinsfilePipelineStep deleteDir dependencyCheckAnalyzer dependencyCheckPublisher dependencyCheckUpdateOnly +syn keyword jenkinsfilePipelineStep dependencyTrackPublisher deployAPI deployArtifacts deployLambda dingding dir disk +syn keyword jenkinsfilePipelineStep dockerFingerprintFrom dockerFingerprintRun dockerNode dockerPullStep dockerPushStep +syn keyword jenkinsfilePipelineStep dockerPushWithProxyStep doktor downloadProgetPackage downstreamPublisher dropbox +syn keyword jenkinsfilePipelineStep dry ec2 ec2ShareAmi echo ecrLogin emailext emailextrecipients envVarsForTool error +syn keyword jenkinsfilePipelineStep evaluateGate eventSourceLambda executeCerberusCampaign exportPackages exportProjects +syn keyword jenkinsfilePipelineStep exws exwsAllocate figlet fileExists fileOperations findFiles findbugs fingerprint +syn keyword jenkinsfilePipelineStep flywayrunner ftp ftpPublisher gatlingArchive getArtifactoryServer getContext getLastChangesPublisher +syn keyword jenkinsfilePipelineStep git gitbisect githubNotify gitlabBuilds gitlabCommitStatus googleCloudBuild googleStorageDownload +syn keyword jenkinsfilePipelineStep googleStorageUpload gprbuild greet hipchatSend http httpRequest hub_detect hub_scan +syn keyword jenkinsfilePipelineStep hub_scan_failure hubotApprove hubotSend importPackages importProjects inNamespace +syn keyword jenkinsfilePipelineStep inSession initConanClient input invokeLambda isUnix ispwOperation ispwRegisterWebhook +syn keyword jenkinsfilePipelineStep ispwWaitForWebhook jacoco jdbc jiraAddComment jiraAddWatcher jiraAssignIssue jiraAssignableUserSearch +syn keyword jenkinsfilePipelineStep jiraComment jiraDeleteAttachment jiraDeleteIssueLink jiraDeleteIssueRemoteLink jiraDeleteIssueRemoteLinks +syn keyword jenkinsfilePipelineStep jiraDownloadAttachment jiraEditComment jiraEditComponent jiraEditIssue jiraEditVersion +syn keyword jenkinsfilePipelineStep jiraGetAttachmentInfo jiraGetComment jiraGetComments jiraGetComponent jiraGetComponentIssueCount +syn keyword jenkinsfilePipelineStep jiraGetFields jiraGetIssue jiraGetIssueLink jiraGetIssueLinkTypes jiraGetIssueRemoteLink +syn keyword jenkinsfilePipelineStep jiraGetIssueRemoteLinks jiraGetIssueTransitions jiraGetIssueWatches jiraGetProject +syn keyword jenkinsfilePipelineStep jiraGetProjectComponents jiraGetProjectStatuses jiraGetProjectVersions jiraGetProjects +syn keyword jenkinsfilePipelineStep jiraGetVersion jiraIssueSelector jiraJqlSearch jiraLinkIssues jiraNewComponent jiraNewIssue +syn keyword jenkinsfilePipelineStep jiraNewIssueRemoteLink jiraNewIssues jiraNewVersion jiraNotifyIssue jiraSearch jiraTransitionIssue +syn keyword jenkinsfilePipelineStep jiraUploadAttachment jiraUserSearch jmhReport jobDsl junit klocworkBuildSpecGeneration +syn keyword jenkinsfilePipelineStep klocworkIncremental klocworkIntegrationStep1 klocworkIntegrationStep2 klocworkIssueSync +syn keyword jenkinsfilePipelineStep klocworkQualityGateway klocworkWrapper kubernetesApply kubernetesDeploy lastChanges +syn keyword jenkinsfilePipelineStep library libraryResource liquibaseDbDoc liquibaseRollback liquibaseUpdate listAWSAccounts +syn keyword jenkinsfilePipelineStep livingDocs loadRunnerTest lock logstashSend mail marathon mattermostSend memoryMap +syn keyword jenkinsfilePipelineStep milestone mockLoad newArtifactoryServer newBuildInfo newGradleBuild newMavenBuild +syn keyword jenkinsfilePipelineStep nexusArtifactUploader nexusPolicyEvaluation nexusPublisher node nodejs nodesByLabel +syn keyword jenkinsfilePipelineStep notifyBitbucket notifyDeploymon notifyOTC nunit nvm octoPerfTest office365ConnectorSend +syn keyword jenkinsfilePipelineStep openTasks openshiftBuild openshiftCreateResource openshiftDeleteResourceByJsonYaml +syn keyword jenkinsfilePipelineStep openshiftDeleteResourceByKey openshiftDeleteResourceByLabels openshiftDeploy openshiftExec +syn keyword jenkinsfilePipelineStep openshiftImageStream openshiftScale openshiftTag openshiftVerifyBuild openshiftVerifyDeployment +syn keyword jenkinsfilePipelineStep openshiftVerifyService openstackMachine osfBuilderSuiteForSFCCDeploy p4 p4approve +syn keyword jenkinsfilePipelineStep p4publish p4sync p4tag p4unshelve pagerduty parasoftFindings pcBuild pdrone perfReport +syn keyword jenkinsfilePipelineStep perfSigReports perfpublisher plot pmd podTemplate powershell pragprog pretestedIntegrationPublisher +syn keyword jenkinsfilePipelineStep properties protecodesc publishATX publishBrakeman publishBuildInfo publishBuildRecord +syn keyword jenkinsfilePipelineStep publishConfluence publishDeployRecord publishETLogs publishEventQ publishGenerators +syn keyword jenkinsfilePipelineStep publishHTML publishLambda publishLastChanges publishSQResults publishStoplight publishTMS +syn keyword jenkinsfilePipelineStep publishTRF publishTestResult publishTraceAnalysis publishUNIT publishValgrind pullPerfSigReports +syn keyword jenkinsfilePipelineStep puppetCode puppetHiera puppetJob puppetQuery pushImage pushToCloudFoundry pwd pybat +syn keyword jenkinsfilePipelineStep pysh qc queryModuleBuildRequest questavrm r radargunreporting rancher readFile readJSON +syn keyword jenkinsfilePipelineStep readManifest readMavenPom readProperties readTrusted readXml readYaml realtimeJUnit +syn keyword jenkinsfilePipelineStep registerWebhook release resolveScm retry rocketSend rtp runConanCommand runFromAlmBuilder +syn keyword jenkinsfilePipelineStep runLoadRunnerScript runValgrind s3CopyArtifact s3Delete s3Download s3FindFiles s3Upload +syn keyword jenkinsfilePipelineStep salt sauce saucePublisher sauceconnect script selectRun sendCIMessage sendDeployableMessage +syn keyword jenkinsfilePipelineStep serviceNow_attachFile serviceNow_attachZip serviceNow_createChange serviceNow_getCTask +syn keyword jenkinsfilePipelineStep serviceNow_getChangeState serviceNow_updateChangeItem setAccountAlias setGerritReview +syn keyword jenkinsfilePipelineStep setGitHubPullRequestStatus sh sha1 signAndroidApks silkcentral silkcentralCollectResults +syn keyword jenkinsfilePipelineStep slackSend sleep sloccountPublish snsPublish snykSecurity sonarToGerrit sparkSend +syn keyword jenkinsfilePipelineStep splitTests springBoot sscm sseBuild sseBuildAndPublish sshPublisher sshagent stage +syn keyword jenkinsfilePipelineStep startET startSandbox startSession startTS stash step stepcounter stopET stopSandbox +syn keyword jenkinsfilePipelineStep stopSession stopTS submitJUnitTestResultsToqTest submitModuleBuildRequest svChangeModeStep +syn keyword jenkinsfilePipelineStep svDeployStep svExportStep svUndeployStep svn tagImage task teamconcert tee testFolder +syn keyword jenkinsfilePipelineStep testPackage testProject testiniumExecution themisRefresh themisReport throttle time +syn keyword jenkinsfilePipelineStep timeout timestamps tm tool touch triggerInputStep triggerJob typetalkSend uftScenarioLoad +syn keyword jenkinsfilePipelineStep unarchive unstash unzip updateBotPush updateGitlabCommitStatus updateIdP updateTrustPolicy +syn keyword jenkinsfilePipelineStep upload-pgyer uploadProgetPackage uploadToIncappticConnect vSphere validateDeclarativePipeline +syn keyword jenkinsfilePipelineStep vmanagerLaunch waitForCIMessage waitForJob waitForQualityGate waitForWebhook waitUntil +syn keyword jenkinsfilePipelineStep walk waptProReport warnings whitesource winRMClient withAWS withAnt withContext withCoverityEnv +syn keyword jenkinsfilePipelineStep withCredentials withDockerContainer withDockerRegistry withDockerServer withEnv withKafkaLog +syn keyword jenkinsfilePipelineStep withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv +syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml +syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xldCreatePackage xldDeploy xldPublishPackage xlrCreateRelease +syn keyword jenkinsfilePipelineStep xrayScanBuild zip -hi link jenkinsfileCoreStep Function -hi link jenkinsfilePluginStep Include -hi link jenkinsfileBuiltInVariable Identifier +hi link jenkinsfileSection Statement +hi link jenkinsfileDirective jenkinsfileSection +hi link jenkinsfileOption Function +hi link jenkinsfileCoreStep Function +hi link jenkinsfilePipelineStep Include +hi link jenkinsfileBuiltInVariable Identifier +hi link jenkinsFileDockerKeyword jenkinsfilePipelineStep let b:current_syntax = "Jenkinsfile" diff --git a/syntax/ansible.vim b/syntax/ansible.vim index c610c41d..0b732101 100644 --- a/syntax/ansible.vim +++ b/syntax/ansible.vim @@ -3,28 +3,23 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 " Vim syntax file " Language: Ansible YAML/Jinja templates " Maintainer: Dave Honneffer <pearofducks@gmail.com> -" Last Change: 2015.09.06 - -if exists("b:current_syntax") - finish -endif +" Last Change: 2018.02.08 if !exists("main_syntax") let main_syntax = 'yaml' endif -let b:current_syntax = '' -unlet b:current_syntax -runtime! syntax/yaml.vim - -let b:current_syntax = '' -unlet b:current_syntax -syntax include @Yaml syntax/yaml.vim +if exists('b:current_syntax') + let s:current_syntax=b:current_syntax + unlet b:current_syntax +endif -let b:current_syntax = '' -unlet b:current_syntax syntax include @Jinja syntax/jinja2.vim +if exists('s:current_syntax') + let b:current_syntax=s:current_syntax +endif + " Jinja " ================================ @@ -39,6 +34,12 @@ highlight link jinjaVarDelim Delimiter " YAML " ================================ +if exists("g:ansible_yamlKeyName") + let s:yamlKey = g:ansible_yamlKeyName +else + let s:yamlKey = "yamlBlockMappingKey" +endif + " Reset some YAML to plain styling " the number 80 in Ansible isn't any more important than the word root highlight link yamlInteger NONE @@ -46,58 +47,9 @@ highlight link yamlBool NONE highlight link yamlFlowString NONE " but it does make sense we visualize quotes easily highlight link yamlFlowStringDelimiter Delimiter - -fun! s:normal_keywords_highlight(name) - if a:name == 'Comment' - highlight link ansible_normal_keywords Comment - elseif a:name == 'Constant' - highlight link ansible_normal_keywords Constant - elseif a:name == 'Identifier' - highlight link ansible_normal_keywords Identifier - elseif a:name == 'Statement' - highlight link ansible_normal_keywords Statement - elseif a:name == 'PreProc' - highlight link ansible_normal_keywords PreProc - elseif a:name == 'Type' - highlight link ansible_normal_keywords Type - elseif a:name == 'Special' - highlight link ansible_normal_keywords Special - elseif a:name == 'Underlined' - highlight link ansible_normal_keywords Underlined - elseif a:name == 'Ignore' - highlight link ansible_normal_keywords Ignore - elseif a:name == 'Error' - highlight link ansible_normal_keywords Error - elseif a:name == 'Todo' - highlight link ansible_normal_keywords Todo - endif -endfun - -fun! s:with_keywords_highlight(name) - if a:name == 'Comment' - highlight link ansible_with_keywords Comment - elseif a:name == 'Constant' - highlight link ansible_with_keywords Constant - elseif a:name == 'Identifier' - highlight link ansible_with_keywords Identifier - elseif a:name == 'Statement' - highlight link ansible_with_keywords Statement - elseif a:name == 'PreProc' - highlight link ansible_with_keywords PreProc - elseif a:name == 'Type' - highlight link ansible_with_keywords Type - elseif a:name == 'Special' - highlight link ansible_with_keywords Special - elseif a:name == 'Underlined' - highlight link ansible_with_keywords Underlined - elseif a:name == 'Ignore' - highlight link ansible_with_keywords Ignore - elseif a:name == 'Error' - highlight link ansible_with_keywords Error - elseif a:name == 'Todo' - highlight link ansible_with_keywords Todo - endif -endfun +" This is only found in stephypy/vim-yaml, since it's one line it isn't worth +" making conditional +highlight link yamlConstant NONE fun! s:attribute_highlight(attributes) if a:attributes =~ 'a' @@ -121,7 +73,7 @@ else endif if exists("g:ansible_name_highlight") - syn keyword ansible_name name containedin=yamlBlockMappingKey contained + execute 'syn keyword ansible_name name containedin='.s:yamlKey.' contained' if g:ansible_name_highlight =~ 'd' highlight link ansible_name Comment else @@ -129,24 +81,24 @@ if exists("g:ansible_name_highlight") endif endif -syn keyword ansible_debug_keywords debug containedin=yamlBlockMappingKey contained +execute 'syn keyword ansible_debug_keywords debug containedin='.s:yamlKey.' contained' highlight link ansible_debug_keywords Debug if exists("g:ansible_extra_keywords_highlight") - syn keyword ansible_extra_special_keywords register always_run changed_when failed_when no_log args vars delegate_to ignore_errors containedin=yamlBlockMappingKey contained + execute 'syn keyword ansible_extra_special_keywords register always_run changed_when failed_when no_log args vars delegate_to ignore_errors containedin='.s:yamlKey.' contained' highlight link ansible_extra_special_keywords Statement endif -syn keyword ansible_normal_keywords include include_tasks import_tasks until retries delay when only_if become become_user block rescue always notify containedin=yamlBlockMappingKey contained +execute 'syn keyword ansible_normal_keywords include include_tasks import_tasks until retries delay when only_if become become_user block rescue always notify containedin='.s:yamlKey.' contained' if exists("g:ansible_normal_keywords_highlight") - call s:normal_keywords_highlight(g:ansible_normal_keywords_highlight) + execute 'highlight link ansible_normal_keywords '.g:ansible_normal_keywords_highlight else highlight link ansible_normal_keywords Statement endif -syn match ansible_with_keywords "\vwith_.+" containedin=yamlBlockMappingKey contained +execute 'syn match ansible_with_keywords "\vwith_.+" containedin='.s:yamlKey.' contained' if exists("g:ansible_with_keywords_highlight") - call s:with_keywords_highlight(g:ansible_with_keywords_highlight) + execute 'highlight link ansible_with_keywords '.g:ansible_with_keywords_highlight else highlight link ansible_with_keywords Statement endif diff --git a/syntax/ansible_template.vim b/syntax/ansible_template.vim deleted file mode 100644 index 31ca4b24..00000000 --- a/syntax/ansible_template.vim +++ /dev/null @@ -1,31 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 - -" Vim syntax file -" Language: Ansible YAML/Jinja templates -" Maintainer: Dave Honneffer <pearofducks@gmail.com> -" Last Change: 2015.09.06 - -if exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'jinja2' -endif - -let b:current_syntax = '' -unlet b:current_syntax -runtime! syntax/jinja2.vim - -if exists("g:ansible_extra_syntaxes") - let s:extra_syntax = split(g:ansible_extra_syntaxes) - for syntax_name in s:extra_syntax - let b:current_syntax = '' - unlet b:current_syntax - execute 'runtime!' "syntax/" . syntax_name - endfor -endif - -let b:current_syntax = "ansible_template" - -endif diff --git a/syntax/blade.vim b/syntax/blade.vim index 7ae2786a..e517dd16 100644 --- a/syntax/blade.vim +++ b/syntax/blade.vim @@ -33,12 +33,12 @@ syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" c syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include \ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue - \ @unset @lang @choice @component @slot @prepend + \ @unset @lang @choice @component @slot @prepend @json @isset @auth @guest @switch @case @includeFirst @empty \ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt -syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan +syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @endforelse @endwhile @endcan \ @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim @endcomponent - \ @endslot @endprepend + \ @endslot @endprepend @endisset @endempty @endauth @endguest @endswitch \ containedin=ALLBUT,@bladeExempt if exists('g:blade_custom_directives') diff --git a/syntax/carp.vim b/syntax/carp.vim index 176c4d55..9896f734 100644 --- a/syntax/carp.vim +++ b/syntax/carp.vim @@ -23,33 +23,34 @@ syn keyword carpSyntax defmacro defdynamic quote cons list array syn keyword carpSyntax expand deftype register system-include register-type syn keyword carpSyntax defmodule copy use module defalias definterface eval syn keyword carpSyntax expand instantiate type info help quit env build run -syn keyword carpSyntax cat use project-set! local-include system-include +syn keyword carpSyntax cat project-set! local-include syn keyword carpSyntax add-cflag add-lib project load reload let-do ignore syn keyword carpSyntax fmt mac-only linux-only windows-only use-all when syn keyword carpSyntax unless defn-do comment forever-do case and* or* -syn keyword carpSyntax str* println* +syn keyword carpSyntax str* println* break doc sig hidden private syn match carpSyntax "\vc(a|d){1,4}r" syn keyword carpFunc Int Float Double Bool String Char Array Fn Ref Long λ +syn keyword carpFunc Pattern syn keyword carpFunc not or and + - * / = /= >= <= > < inc dec -syn keyword carpFunc println print get-line from-string mod seed random +syn keyword carpFunc println print get-line from-string mod random syn keyword carpFunc random-between str mask delete append count duplicate syn keyword carpFunc cstr chars from-chars to-int from-int sin cos sqrt acos -syn keyword carpFunc atan2 exit time srand for cond floor abs sort-with +syn keyword carpFunc atan2 exit time seed-random for cond floor abs sort-with syn keyword carpFunc subarray prefix-array suffix-array reverse sum min max syn keyword carpFunc first last reduce format zero read-file bit-shift-left syn keyword carpFunc bit-shift-right bit-and bit-or bit-xor bit-not safe-add syn keyword carpFunc safe-sub safe-mul even? odd? cmp allocate repeat-indexed syn keyword carpFunc sanitize-addresses memory-balance reset-memory-balance! syn keyword carpFunc log-memory-balance! memory-logged assert-balanced trace -syn keyword carpFunc pi e swaop! update! char-at tail head split-by words lines +syn keyword carpFunc pi e swap! update! char-at tail head split-by words lines syn keyword carpFunc pad-left pad-right count-char empty? random-sized substring syn keyword carpFunc prefix-string suffix-string starts-with? ends-with? -syn keyword carpFunc string-join free sleep-seconds sleep-micros -syn keyword carpFunc atan2 exit time srand for cond floor abs neg to-float +syn keyword carpFunc string-join free sleep-seconds sleep-micros substitute +syn keyword carpFunc neg to-float match matches? find global-match match-str syn keyword carpFunc from-float tan asin atan cosh sinh tanh exp frexp ldexp syn keyword carpFunc log log10 modf pow ceil clamp approx refstr foreach -syn keyword carpFunc => ==> repeat nth replicate range raw aset aset! count +syn keyword carpFunc => ==> repeat nth replicate range raw aset aset! syn keyword carpFunc push-back pop-back sort index-of element-count @@ -75,8 +76,9 @@ syn region carpStruc matchgroup=Delimiter start="("rs=s+1 matchgroup=Delimiter e syn region carpStruc matchgroup=Delimiter start="\["rs=s+1 matchgroup=Delimiter end="\]"re=e-1 contains=@carpNormal syn region carpString start=/\%(\\\)\@<!"/ skip=/\\[\\"]/ end=/"/ +syn region carpPattern start=/\%(\\\)\@<!\#"/ skip=/\\[\\"]/ end=/"/ -syn cluster carpNormal add=carpError,carpStruc,carpString +syn cluster carpNormal add=carpError,carpStruc,carpString,carpPattern syn cluster carpQuotedOrNormal add=carpString syn match carpNumber "\<[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?[lf]\?\>" contains=carpContainedNumberError @@ -116,6 +118,7 @@ if version >= 508 || !exists("carp_syntax_init") HiLink carpCopy Function HiLink carpString String + HiLink carpPattern String HiLink carpChar Character HiLink carpBoolean Boolean diff --git a/syntax/coffee.vim b/syntax/coffee.vim index 51973059..b7494029 100644 --- a/syntax/coffee.vim +++ b/syntax/coffee.vim @@ -34,7 +34,7 @@ hi def link coffeeConditional Conditional syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display hi def link coffeeException Exception -syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\|default\|await\)\>/ +syn match coffeeKeyword /\<\%(new\|in\|of\|from\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\|default\|await\)\>/ \ display " The `own` keyword is only a keyword after `for`. syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat diff --git a/syntax/crystal.vim b/syntax/crystal.vim index 5b13d4c1..32629781 100644 --- a/syntax/crystal.vim +++ b/syntax/crystal.vim @@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 " Language: Crystal " Based on Ruby syntax highlight -" which is made by Mirko Nasato and Doug Kearns +" which was made by Mirko Nasato and Doug Kearns " --------------------------------------------- if exists('b:current_syntax') @@ -66,9 +66,9 @@ syn match crystalRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" co syn match crystalRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display syn match crystalRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display -syn cluster crystalStringSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape +syn cluster crystalStringSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape syn cluster crystalExtendedStringSpecial contains=@crystalStringSpecial,crystalNestedParentheses,crystalNestedCurlyBraces,crystalNestedAngleBrackets,crystalNestedSquareBrackets -syn cluster crystalRegexpSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape,crystalRegexpSpecial,crystalRegexpEscape,crystalRegexpBrackets,crystalRegexpCharClass,crystalRegexpDot,crystalRegexpQuantifier,crystalRegexpAnchor,crystalRegexpParens,crystalRegexpComment +syn cluster crystalRegexpSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape,crystalRegexpSpecial,crystalRegexpEscape,crystalRegexpBrackets,crystalRegexpCharClass,crystalRegexpDot,crystalRegexpQuantifier,crystalRegexpAnchor,crystalRegexpParens,crystalRegexpComment " Numbers and ASCII Codes syn match crystalASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" @@ -129,7 +129,7 @@ syn region crystalString matchgroup=crystalStringDelimiter start="\"" end="\"" s syn region crystalString matchgroup=crystalStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@crystalStringSpecial fold " Character -syn match crystalCharLiteral "'\%([^\\]\|\\[abefnrstv'\\]\|\\\o\{1,3}\|\\x\x\{1,2}\|\\u\x\{4}\)'" contained display +syn match crystalCharLiteral "'\%([^\\]\|\\[abefnrstv'\\]\|\\\o\{1,3}\|\\x\x\{1,2}\|\\u\x\{4}\)'" contains=crystalStringEscape display " Generalized Single Quoted String, Symbol and Array of Strings syn region crystalString matchgroup=crystalStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold diff --git a/syntax/elixir.vim b/syntax/elixir.vim index f8faf487..2ed25a5c 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -18,25 +18,15 @@ syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDec syn match elixirComment '#.*' contains=elixirTodo,@Spell syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained -syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable,elixirKernelFunction +syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable -syn match elixirKeyword '\(\.\)\@<!\<\(for\|case\|when\|with\|cond\|if\|unless\|try\|receive\|send\)\>' -syn match elixirKeyword '\(\.\)\@<!\<\(exit\|raise\|throw\|after\|rescue\|catch\|else\)\>' -syn match elixirKeyword '\(\.\)\@<!\<\(quote\|unquote\|super\|spawn\|spawn_link\|spawn_monitor\)\>' - -" Kernel functions -syn keyword elixirKernelFunction contained is_atom is_binary is_bitstring is_boolean is_float -syn keyword elixirKernelFunction contained is_function is_integer is_list is_map is_nil -syn keyword elixirKernelFunction contained is_number is_pid is_port is_reference is_tuple -syn keyword elixirKernelFunction contained abs binary_part bit_size byte_size div elem hd length -syn keyword elixirKernelFunction contained map_size node rem round tl trunc tuple_size +syn match elixirKeyword '\(\.\)\@<!\<\(for\|case\|when\|with\|cond\|if\|unless\|try\|receive\|send\|exit\|raise\|throw\|after\|rescue\|catch\|else\|quote\|unquote\|super\|spawn\|spawn_link\|spawn_monitor\|is_atom\|is_binary\|is_bitstring\|is_boolean\|is_float\|is_function\|is_integer\|is_list\|is_map\|is_nil\|is_number\|is_pid\|is_port\|is_reference\|is_tuple\|abs\|binary_part\|bit_size\|byte_size\|div\|elem\|hd\|length\|map_size\|node\|rem\|round\|tl\|trunc\|tuple_size\)\>' syn keyword elixirInclude import require alias use syn keyword elixirSelf self -" This unfortunately also matches function names in function calls -syn match elixirUnusedVariable contained '\v%(^|[^.])@<=<_\w*>' +syn match elixirUnusedVariable contained '\%(\.\)\@<!\<_\w*\>\%((\)\@!' syn match elixirOperator '\v\.@<!<%(and|or|in|not)>' syn match elixirOperator '!==\|!=\|!' @@ -88,16 +78,16 @@ syn region elixirString matchgroup=elixirStringDelimiter start=+\z('\)+ end=+ syn region elixirString matchgroup=elixirStringDelimiter start=+\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@Spell,@elixirStringContained syn region elixirString matchgroup=elixirStringDelimiter start=+\z('''\)+ end=+^\s*\z1+ contains=@Spell,@elixirStringContained syn region elixirString matchgroup=elixirStringDelimiter start=+\z("""\)+ end=+^\s*\z1+ contains=@Spell,@elixirStringContained -syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirKernelFunction,elixirComment,@elixirNotTop +syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)" -syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold -syn region elixirElseBlock matchgroup=elixirBlockDefinition start="\<else\>:\@!" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold -syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold +syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold +syn region elixirElseBlock matchgroup=elixirBlockDefinition start="\<else\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold +syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold -syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigil,elixirAnonymousFunction +syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigil,elixirAnonymousFunction,elixirComment syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE @@ -167,8 +157,8 @@ syn match elixirRecordDeclaration "[^[:space:];#<]\+" contained con syn match elixirMacroDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl syn match elixirDelegateDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl syn region elixirDelegateDeclaration start='\[' end='\]' contained contains=elixirFunctionDeclaration skipwhite skipnl -syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl -syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl +syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl +syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl " ExUnit @@ -176,7 +166,7 @@ syn match elixirExUnitMacro "\(^\s*\)\@<=\<\(test\|describe\|setup\|setup_all\| syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(assert\|assert_in_delta\|assert_raise\|assert_receive\|assert_received\|catch_error\)\>" syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(catch_exit\|catch_throw\|flunk\|refute\|refute_in_delta\|refute_receive\|refute_received\)\>" -hi def link elixirBlockDefinition Keyword +hi def link elixirBlockDefinition Define hi def link elixirDefine Define hi def link elixirPrivateDefine Define hi def link elixirGuard Define @@ -200,9 +190,8 @@ hi def link elixirMacroDeclaration Macro hi def link elixirInclude Include hi def link elixirComment Comment hi def link elixirTodo Todo -hi def link elixirKeyword Keyword +hi def link elixirKeyword Define hi def link elixirExUnitAssert Keyword -hi def link elixirKernelFunction Keyword hi def link elixirOperator Operator hi def link elixirAtom Constant hi def link elixirPseudoVariable Constant diff --git a/syntax/gitcommit.vim b/syntax/gitcommit.vim index 74477b27..8746a754 100644 --- a/syntax/gitcommit.vim +++ b/syntax/gitcommit.vim @@ -20,11 +20,18 @@ endif syn include @gitcommitDiff syntax/diff.vim syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff -syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell syn match gitcommitOverflow ".*" contained contains=@Spell syn match gitcommitBlank "^[^#].*" contained contains=@Spell -syn match gitcommitComment "^#.*" + +if get(g:, "gitcommit_cleanup") is# "scissors" + syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank skipnl + syn region gitcommitComment start=/^# -\+ >8 -\+$/ end=/\%$/ contains=gitcommitDiff +else + syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl + syn match gitcommitComment "^#.*" +endif + syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite diff --git a/syntax/gitconfig.vim b/syntax/gitconfig.vim index 49b992b0..fbdedc51 100644 --- a/syntax/gitconfig.vim +++ b/syntax/gitconfig.vim @@ -10,18 +10,16 @@ if exists("b:current_syntax") finish endif -setlocal iskeyword+=- -setlocal iskeyword-=_ syn case ignore syn sync minlines=10 syn match gitconfigComment "[#;].*" syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]" syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]' -syn match gitconfigVariable "\%(^\s*\)\@<=\a\k*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite +syn match gitconfigVariable "\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite syn region gitconfigAssignment matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend syn keyword gitconfigBoolean true false yes no contained -syn match gitconfigNumber "\d\+" contained +syn match gitconfigNumber "\<\d\+\>" contained syn region gitconfigString matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError syn match gitconfigError +\\.+ contained syn match gitconfigEscape +\\[\\"ntb]+ contained diff --git a/syntax/go.vim b/syntax/go.vim index 0705c3ee..c02ad504 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -11,102 +11,6 @@ if exists("b:current_syntax") finish endif -" Set settings to default values. -if !exists("g:go_highlight_array_whitespace_error") - let g:go_highlight_array_whitespace_error = 0 -endif - -if !exists("g:go_highlight_chan_whitespace_error") - let g:go_highlight_chan_whitespace_error = 0 -endif - -if !exists("g:go_highlight_extra_types") - let g:go_highlight_extra_types = 0 -endif - -if !exists("g:go_highlight_space_tab_error") - let g:go_highlight_space_tab_error = 0 -endif - -if !exists("g:go_highlight_trailing_whitespace_error") - let g:go_highlight_trailing_whitespace_error = 0 -endif - -if !exists("g:go_highlight_operators") - let g:go_highlight_operators = 0 -endif - -if !exists("g:go_highlight_functions") - let g:go_highlight_functions = 0 -endif - -if !exists("g:go_highlight_function_arguments") - let g:go_highlight_function_arguments = 0 -endif - -if !exists("g:go_highlight_function_calls") - let g:go_highlight_function_calls = 0 -endif - -if !exists("g:go_highlight_fields") - let g:go_highlight_fields = 0 -endif - -if !exists("g:go_highlight_types") - let g:go_highlight_types = 0 -endif - -if !exists("g:go_highlight_build_constraints") - let g:go_highlight_build_constraints = 0 -endif - -if !exists("g:go_highlight_string_spellcheck") - let g:go_highlight_string_spellcheck = 1 -endif - -if !exists("g:go_highlight_format_strings") - let g:go_highlight_format_strings = 1 -endif - -if !exists("g:go_highlight_generate_tags") - let g:go_highlight_generate_tags = 0 -endif - -if !exists("g:go_highlight_variable_assignments") - let g:go_highlight_variable_assignments = 0 -endif - -if !exists("g:go_highlight_variable_declarations") - let g:go_highlight_variable_declarations = 0 -endif - -let s:fold_block = 1 -let s:fold_import = 1 -let s:fold_varconst = 1 -let s:fold_package_comment = 1 -let s:fold_comment = 0 - -if exists("g:go_fold_enable") - " Enabled by default. - if index(g:go_fold_enable, 'block') == -1 - let s:fold_block = 0 - endif - if index(g:go_fold_enable, 'import') == -1 - let s:fold_import = 0 - endif - if index(g:go_fold_enable, 'varconst') == -1 - let s:fold_varconst = 0 - endif - if index(g:go_fold_enable, 'package_comment') == -1 - let s:fold_package_comment = 0 - endif - - " Disabled by default. - if index(g:go_fold_enable, 'comment') > -1 - let s:fold_comment = 1 - endif -endif - syn case match syn keyword goPackage package @@ -144,7 +48,6 @@ hi def link goUnsignedInts Type hi def link goFloats Type hi def link goComplexes Type - " Predefined functions and values syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/ @@ -160,7 +63,7 @@ syn keyword goTodo contained TODO FIXME XXX BUG syn cluster goCommentGroup contains=goTodo syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell -if s:fold_comment +if go#config#FoldEnable('comment') syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold else @@ -170,7 +73,7 @@ endif hi def link goComment Comment hi def link goTodo Todo -if g:go_highlight_generate_tags != 0 +if go#config#HighlightGenerateTags() syn match goGenerateVariables contained /\(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/ syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables hi def link goGenerate PreProc @@ -195,7 +98,7 @@ hi def link goEscapeError Error " Strings and their contents syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError -if g:go_highlight_string_spellcheck != 0 +if go#config#HighlightStringSpellcheck() syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell syn region goRawString start=+`+ end=+`+ contains=@Spell else @@ -203,7 +106,7 @@ else syn region goRawString start=+`+ end=+`+ endif -if g:go_highlight_format_strings != 0 +if go#config#HighlightFormatStrings() " [n] notation is valid for specifying explicit argument indexes " 1. Match a literal % not preceded by a %. " 2. Match any number of -, #, 0, space, or + @@ -231,21 +134,21 @@ hi def link goCharacter Character " Regions syn region goParen start='(' end=')' transparent -if s:fold_block +if go#config#FoldEnable('block') syn region goBlock start="{" end="}" transparent fold else syn region goBlock start="{" end="}" transparent endif " import -if s:fold_import +if go#config#FoldEnable('import') syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment else syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment endif " var, const -if s:fold_varconst +if go#config#FoldEnable('varconst') syn region goVar start='var (' end='^\s*)$' transparent fold \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments syn region goConst start='const (' end='^\s*)$' transparent fold @@ -288,12 +191,12 @@ hi def link goImaginary Number hi def link goImaginaryFloat Float " Spaces after "[]" -if g:go_highlight_array_whitespace_error != 0 +if go#config#HighlightArrayWhitespaceError() syn match goSpaceError display "\(\[\]\)\@<=\s\+" endif " Spacing errors around the 'chan' keyword -if g:go_highlight_chan_whitespace_error != 0 +if go#config#HighlightChanWhitespaceError() " receive-only annotation on chan type " " \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan) @@ -311,7 +214,7 @@ if g:go_highlight_chan_whitespace_error != 0 endif " Extra types commonly seen -if g:go_highlight_extra_types != 0 +if go#config#HighlightExtraTypes() syn match goExtraType /\<bytes\.\(Buffer\)\>/ syn match goExtraType /\<io\.\(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/ syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/ @@ -319,12 +222,12 @@ if g:go_highlight_extra_types != 0 endif " Space-tab error -if g:go_highlight_space_tab_error != 0 +if go#config#HighlightSpaceTabError() syn match goSpaceError display " \+\t"me=e-1 endif " Trailing white space error -if g:go_highlight_trailing_whitespace_error != 0 +if go#config#HighlightTrailingWhitespaceError() syn match goSpaceError display excludenl "\s\+$" endif @@ -342,7 +245,7 @@ hi def link goTodo Todo syn match goVarArgs /\.\.\./ " Operators; -if g:go_highlight_operators != 0 +if go#config#HighlightOperators() " match single-char operators: - + % < > ! & | ^ * = " and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= == syn match goOperator /[-+%<>!&|^*=]=\?/ @@ -361,13 +264,13 @@ endif hi def link goOperator Operator " Functions; -if g:go_highlight_functions isnot 0 || g:go_highlight_function_arguments isnot 0 +if go#config#HighlightFunctions() || go#config#HighlightFunctionArguments() syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleArguments skipwhite skipnl syn match goReceiverVar /\w\+\ze\s\+\(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl syn match goFunction /\w\+/ nextgroup=goSimpleArguments contained skipwhite skipnl syn match goReceiverType /\w\+/ contained -if g:go_highlight_function_arguments isnot 0 +if go#config#HighlightFunctionArguments() syn match goSimpleArguments /(\(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goArgumentName nextgroup=goSimpleArguments skipwhite skipnl syn match goArgumentName /\w\+\(\s*,\s*\w\+\)*\ze\s\+\(\w\|\.\|\*\|\[\)/ contained nextgroup=goArgumentType skipwhite skipnl syn match goArgumentType /\([^,)]\|\_s\)\+,\?/ contained nextgroup=goArgumentName skipwhite skipnl @@ -382,19 +285,19 @@ endif hi def link goFunction Function " Function calls; -if g:go_highlight_function_calls != 0 +if go#config#HighlightFunctionCalls() syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration endif hi def link goFunctionCall Type " Fields; -if g:go_highlight_fields != 0 +if go#config#HighlightFields() syn match goField /\.\w\+\([.\ \n\r\:\)\[,]\)\@=/hs=s+1 endif hi def link goField Identifier " Structs & Interfaces; -if g:go_highlight_types != 0 +if go#config#HighlightTypes() syn match goTypeConstructor /\<\w\+{\@=/ syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl @@ -410,19 +313,19 @@ hi def link goTypeDecl Keyword hi def link goDeclType Keyword " Variable Assignments -if g:go_highlight_variable_assignments != 0 +if go#config#HighlightVariableAssignments() syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/ hi def link goVarAssign Special endif " Variable Declarations -if g:go_highlight_variable_declarations != 0 +if go#config#HighlightVariableDeclarations() syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/ hi def link goVarDefs Special endif " Build Constraints -if g:go_highlight_build_constraints != 0 +if go#config#HighlightBuildConstraints() syn match goBuildKeyword display contained "+build" " Highlight the known values of GOOS, GOARCH, and other +build options. syn keyword goBuildDirectives contained @@ -444,7 +347,7 @@ if g:go_highlight_build_constraints != 0 hi def link goBuildKeyword PreProc endif -if g:go_highlight_build_constraints != 0 || s:fold_package_comment +if go#config#HighlightBuildConstraints() || go#config#FoldEnable('package_comment') " One or more line comments that are followed immediately by a "package" " declaration are treated like package documentation, so these must be " matched as comments to avoid looking like working build constraints. @@ -453,11 +356,11 @@ if g:go_highlight_build_constraints != 0 || s:fold_package_comment exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/' \ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7' \ . ' contains=@goCommentGroup,@Spell' - \ . (s:fold_package_comment ? ' fold' : '') + \ . (go#config#FoldEnable('package_comment') ? ' fold' : '') exe 'syn region goPackageComment start=/\v\/\*.*\n(.*\n)*\s*\*\/\npackage/' - \ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7' + \ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7' \ . ' contains=@goCommentGroup,@Spell' - \ . (s:fold_package_comment ? ' fold' : '') + \ . (go#config#FoldEnable('package_comment') ? ' fold' : '') hi def link goPackageComment Comment endif diff --git a/syntax/godebugoutput.vim b/syntax/godebugoutput.vim new file mode 100644 index 00000000..f1df1d9e --- /dev/null +++ b/syntax/godebugoutput.vim @@ -0,0 +1,17 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 + +if exists("b:current_syntax") + finish +endif + +syn match godebugOutputErr '^ERR:.*' +syn match godebugOutputOut '^OUT:.*' + +let b:current_syntax = "godebugoutput" + +hi def link godebugOutputErr Comment +hi def link godebugOutputOut Normal + +" vim: sw=2 ts=2 et + +endif diff --git a/syntax/godebugstacktrace.vim b/syntax/godebugstacktrace.vim new file mode 100644 index 00000000..b24f2a3c --- /dev/null +++ b/syntax/godebugstacktrace.vim @@ -0,0 +1,15 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 + +if exists("b:current_syntax") + finish +endif + +syn match godebugStacktrace '^\S\+' + +let b:current_syntax = "godebugoutput" + +hi def link godebugStacktrace SpecialKey + +" vim: sw=2 ts=2 et + +endif diff --git a/syntax/godebugvariables.vim b/syntax/godebugvariables.vim new file mode 100644 index 00000000..0fdada88 --- /dev/null +++ b/syntax/godebugvariables.vim @@ -0,0 +1,27 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 + +if exists("b:current_syntax") + finish +endif + +syn match godebugTitle '^#.*' +syn match godebugVariables '^\s*\S\+\ze:' + +syn keyword goType chan map bool string error +syn keyword goSignedInts int int8 int16 int32 int64 rune +syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr +syn keyword goFloats float32 float64 +syn keyword goComplexes complex64 complex128 + +syn keyword goBoolean true false + +let b:current_syntax = "godebugvariables" + +hi def link godebugTitle Underlined +hi def link godebugVariables Statement +hi def link goType Type +hi def link goBoolean Boolean + +" vim: sw=2 ts=2 et + +endif diff --git a/syntax/gohtmltmpl.vim b/syntax/gohtmltmpl.vim index d4198417..22191178 100644 --- a/syntax/gohtmltmpl.vim +++ b/syntax/gohtmltmpl.vim @@ -12,6 +12,8 @@ runtime! syntax/gotexttmpl.vim runtime! syntax/html.vim unlet b:current_syntax +syn cluster htmlPreproc add=gotplAction,goTplComment + let b:current_syntax = "gohtmltmpl" " vim: sw=2 ts=2 et diff --git a/syntax/haproxy.vim b/syntax/haproxy.vim new file mode 100644 index 00000000..54c54c3c --- /dev/null +++ b/syntax/haproxy.vim @@ -0,0 +1,360 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haproxy') == -1 + +" Vim syntax file +" Language: HAproxy +" Maintainer: Dan Reif +" Last Change: Mar 2, 2018 +" Version: 0.5 +" URL: https://github.com/CH-DanReif/haproxy.vim + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +if version >= 600 + setlocal iskeyword=_,-,a-z,A-Z,48-57 +else + set iskeyword=_,-,a-z,A-Z,48-57 +endif + + +" Escaped chars +syn match hapEscape +\\\(\\\| \|n\|r\|t\|#\|x\x\x\)+ + +" Match whitespace at the end of a line +syn match hapNothingErr /\s\+\ze\(#.*\)\?$/ contained nextgroup=hapGreedyComment +" Match anything other than whitespace; flag as error if found. 'contained' +" because comments are valid where otherwise only hapNothing is. +syn match hapNothingErr /\s*\zs[^# \t][^#]*/ contained nextgroup=hapGreedyComment + +" Comments +syn match hapComment /\(^\|\s\)#.*$/ contains=hapTodo +" `acl foo path_reg hi[#]mom` is an error because [ is unclosed. (!!!) +syn match hapGreedyComment /#.*$/ contained containedin=hapAclRemainder contains=hapTodo +syn keyword hapTodo TODO FIXME XXX contained + +" `daemon#hi mom` is perfectly valid. :/ +syn cluster hapNothing contains=hapNothingErr,hapGreedyComment + +" Case-insensitive matching +syn case ignore + +" Sections +syn match hapSection /^\s*\(global\|defaults\)/ +syn match hapSection /^\s*\(backend\|frontend\|listen\|ruleset\|userlist\)/ skipwhite nextgroup=hapSectLabel +syn match hapSectLabel /\S\+/ skipwhite nextgroup=hapIp1 contained +syn match hapIp1 /\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\?:\d\{1,5}/ nextgroup=hapIp2 contained +syn match hapIp2 /,\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\?:\d\{1,5}/hs=s+1 nextgroup=hapIp2 contained + +" Timeouts. We try to hint towards the use of 'ms' and 's' when +" g:haproxy_guess_ms_sec is set. We consider the lack of either 'ms' or 's' +" as an error when haproxy_enforce_ms_sec is set. (HAproxy's default is 'ms', +" but that arguably leads to ambiguity in the config.) +if get(g:, 'haproxy_guess_ms_sec', 1) + " Timeouts and such specified in ms, where seconds are *allowed*, but are + " probably a mistake. + syn match hapNumberMS /\d\+m\?s/ contained transparent + syn match hapError /\d\+\zss\ze/ contained containedin=hapNumberMS +endif +if get(g:, 'haproxy_enforce_ms_sec', 1) + syn match hapNumberMS /\d\+\(m\?s\)\?/ contained transparent + syn match hapError /\d\+\(m\?s\)\@!\(\D\|$\)/ contained containedin=hapNumberMS + syn match hapNumberMS /\d\+m\?s/ contained +else + syn match hapNumberMS /\d\+m\?s/ contained +endif +if get(g:, 'haproxy_guess_ms_sec', 1) + " Timeouts generally specified in whole seconds, where we want to highlight + " errant 'm's. + syn match hapNumberSec /\d\+m\?s/ contained transparent + syn match hapError /\d\+\zsm\zes/ contained containedin=hapNumberSec +endif +if get(g:, 'haproxy_enforce_ms_sec', 1) + syn match hapNumberSec /\d\+\(m\?s\)\?/ contained transparent + syn match hapError /\d\+\(m\?s\)\@!\(\D\|$\)/ contained containedin=hapNumberSec + syn match hapNumberSec /\d\+m\?s/ contained +else + syn match hapNumberSec /\d\+m\?s/ contained +endif +" Other numbers, no 'ms'. +syn match hapNumber /[0-9]\+/ contained + +" Timeout types +syn keyword hapTimeoutType connect client server contained skipwhite nextgroup=hapNumberMS + +" URIs +syn match hapAbsURI /\/\S*/ contained +syn match hapURI /\S*/ contained + +" File paths (always absolute, and never just '/' unless you're insane) +syn match hapFilePath /\/\S\+/ contained + +" SSL configuration keywords +syn match hapSSLCiphersAll /\s\+\zs.*/ contained transparent +syn match hapSSLCiphersError /.\+/ contained containedin=hapSSLCiphersAll +syn match hapSSLCiphers /\([-+!]\?[A-Z0-9-]\+[:+]\)*[-+!]\?[A-Z0-9-]\+/ contained containedin=hapSSLCiphersAll + +" +" ACLs +" + +" This comes first, lest it gobble up everything else. +syn match hapAclName /\S\+/ contained skipwhite nextgroup=hapAclCriterion +syn match hapAclCriterion /FALSE\|HTTP\|HTTP_1\.0\|HTTP_1\.1\|HTTP_CONTENT\|HTTP_URL_ABS\|HTTP_URL_SLASH\|HTTP_URL_STAR\|LOCALHOST\|METH_CONNECT\|METH_GET\|METH_HEAD\|METH_OPTIONS\|METH_POST\|METH_TRACE\|RDP_COOKIE\|REQ_CONTENT\|TRUE\|WAIT_END\|\(req_rdp_cookie\|s\?cook\|s\?hdr\|http_auth_group\|urlp\)\(_\(beg\|dir\|dom\|end\|len\|reg\|sub\|cnt\)\)\?([^)]*)\|\(req_ssl_[a-z]\+\|base\|method\|path\|req_ver\|resp_ver\|url\)\(_\(beg\|dir\|dom\|end\|len\|reg\|sub\|cnt\)\)\?/ contained skipwhite nextgroup=hapAclConverterOrNothing +" This one's a bit tricky. Match zero or more converters, and then *require* the +" space afterwards. Strictly speaking, deviates from the BNF, but only in +" pathological cases ('acl lolwat TRUE,upper'). +syn match hapAclConverterOrNothing /\(,\(\(base64\|bool\|cpl\|debug\|even\|hex\|lower\|neg\|not\|odd\|upper\|url_dec\)\|\(add\|and\|bytes\|crc32\|da-csv-conv\|div\|djb2\|field\|http_date\|in_table\|ipmask\|json\|language\|ltime\|map\|mod\|mul\|or\|regsub\|capture-req\|capture-res\|sdbm\|sub\|table_[a-z0-9_]\+\|utime\|word\|wt6\|xor\)([^)]*)\)\)*\s\+/ contained nextgroup=hapAclFlag,hapAclFlagWithParameter,hapAclOperator +syn match hapAclFlag /-[-in]/ contained skipwhite nextgroup=hapAclFlag,hapAclFlagWithParameter,hapAclOperator +syn match hapAclFlagWithParameter /-[fmMu]/ contained skipwhite nextgroup=hapAclFlagParameter +syn match hapAclFlagParameter /\S\+/ contained skipwhite nextgroup=hapAclFlag,hapAclFlagWithParameter,hapAclOperator +syn match hapAclOperator /eq\|ge\|gt\|le\|lt/ contained skipwhite +syn match hapAclRemainder /.*/ contained transparent + +" Generic tune.ssl +syn match hapParam /tune\.ssl\.[a-z0-9-]\+/ +" tune.ssl where we know what follows +syn match hapParam /tune\.ssl\.default-dh-param/ skipwhite nextgroup=hapNumber + +syn keyword hapSSLServerVerify none required contained skipwhite nextgroup=@hapNothing + +" Keywords deprecated for at least a decade. Kill 'em. +syn keyword hapError cliexp srvexp + +" Parameters +syn keyword hapParam timeout skipwhite nextgroup=hapTimeoutType +syn keyword hapParam chroot pidfile skipwhite nextgroup=hapFilePath +syn keyword hapParam clitimeout skipwhite nextgroup=hapNumberMS +syn keyword hapParam contimeout skipwhite nextgroup=hapNumberMS +syn keyword hapParam daemon debug disabled skipwhite nextgroup=@hapNothing +syn keyword hapParam enabled skipwhite nextgroup=@hapNothing +syn keyword hapParam fullconn maxconn skipwhite nextgroup=hapNumber +syn keyword hapParam gid skipwhite nextgroup=hapNumber +syn keyword hapParam group +syn keyword hapParam grace skipwhite nextgroup=hapNumberMS +syn keyword hapParam monitor-uri skipwhite nextgroup=hapAbsURI +syn keyword hapParam nbproc skipwhite nextgroup=hapNumber +syn keyword hapParam noepoll nopoll skipwhite nextgroup=@hapNothing +syn keyword hapParam quiet skipwhite nextgroup=@hapNothing +syn keyword hapParam redispatch retries skipwhite nextgroup=hapNumber +" 'add' takes exactly one string, not regexes +syn keyword hapParam reqadd reqiadd skipwhite nextgroup=hapOneStringIfUnless +syn keyword hapParam rspadd rspiadd skipwhite nextgroup=hapOneStringIfUnless +" All of these take exactly one regexp +syn match hapParam /reqi\?\(allow\|del\)/ skipwhite nextgroup=hapOneRegexpIfUnless +syn match hapParam /reqi\?\(deny\|pass\)/ skipwhite nextgroup=hapOneRegexpIfUnless +syn match hapParam /reqi\?\(tarpit\)/ skipwhite nextgroup=hapOneRegexpIfUnless +syn match hapParam /rspi\?\(del\|deny\)/ skipwhite nextgroup=hapOneRegexpIfUnless +" 'rep' is unique in taking two regexes (one search, one replace) +syn keyword hapParam reqrep reqirep skipwhite nextgroup=hapRegSearchReplIfUnless +syn keyword hapParam rsprep rspirep skipwhite nextgroup=hapRegSearchReplIfUnless +syn keyword hapParam reqsetbe reqisetbe skipwhite nextgroup=hapRegexpBE +syn keyword hapParam server source +syn keyword hapParam srvtimeout skipwhite nextgroup=hapNumberMS +syn keyword hapParam uid ulimit-n skipwhite nextgroup=hapNumber +syn keyword hapParam user +syn keyword hapParam acl skipwhite nextgroup=hapAclName +syn keyword hapParam errorloc skipwhite nextgroup=hapStatusURI +syn keyword hapParam errorloc302 errorloc303 skipwhite nextgroup=hapStatusURI +syn keyword hapParam default_backend skipwhite nextgroup=hapSectLabel +syn keyword hapParam use_backend skipwhite nextgroup=hapSectLabel +syn keyword hapParam appsession skipwhite nextgroup=hapAppSess +syn keyword hapParam bind skipwhite nextgroup=hapIp1 +syn keyword hapParam balance skipwhite nextgroup=hapBalance +syn keyword hapParam cookie skipwhite nextgroup=hapCookieNam +syn keyword hapParam capture skipwhite nextgroup=hapCapture +syn keyword hapParam dispatch skipwhite nextgroup=hapIpPort +syn keyword hapParam source skipwhite nextgroup=hapIpPort +syn keyword hapParam mode skipwhite nextgroup=hapMode +syn keyword hapParam monitor-net skipwhite nextgroup=hapIPv4Mask +syn keyword hapParam option skipwhite nextgroup=hapOption +syn keyword hapParam stats skipwhite nextgroup=hapStats +syn keyword hapParam server skipwhite nextgroup=hapServerN +syn keyword hapParam source skipwhite nextgroup=hapServerEOL +syn keyword hapParam log skipwhite nextgroup=hapGLog,hapLogIp,hapFilePath +syn keyword hapParam ca-base skipwhite nextgroup=hapFilePath +syn keyword hapParam crt-base skipwhite nextgroup=hapFilePath +syn keyword hapParam ssl-default-bind-ciphers skipwhite nextgroup=hapSSLCiphersAll +syn keyword hapParam ssl-default-bind-options skipwhite nextgroup=hapGLog,hapLogIp +syn keyword hapParam ssl-server-verify skipwhite nextgroup=hapSSLServerVerify +syn keyword hapParam errorfile skipwhite nextgroup=hapStatusPath +syn keyword hapParam http-request skipwhite nextgroup=hapHttpRequestVerb +" Transparent is a Vim keyword, so we need a regexp to match it +syn match hapParam /transparent/ + +" Options and additional parameters +syn keyword hapAppSess len timeout contained +syn keyword hapBalance roundrobin source contained +syn keyword hapLen len contained +syn keyword hapGLog global contained +syn keyword hapMode http tcp health contained +syn keyword hapOption abortonclose allbackups checkcache clitcpka dontlognull contained +syn keyword hapOption forceclose forwardfor http-server-close contained +syn keyword hapOption httpchk httpclose httplog keepalive logasap contained +syn keyword hapOption persist srvtcpka ssl-hello-chk contained +syn keyword hapOption tcplog tcpka tcpsplice contained +syn keyword hapOption except contained skipwhite nextgroup=hapIPv4Mask +" Transparent is a Vim keyword, so we need a regexp to match it +syn match hapOption /transparent/ contained +syn keyword hapStats realm auth scope enable contained +syn keyword hapStats uri contained skipwhite nextgroup=hapAbsURI +syn keyword hapStats socket contained skipwhite nextgroup=hapFilePath +syn keyword hapStats timeout contained skipwhite nextgroup=hapNumberMS +syn keyword hapLogFac kern user mail daemon auth syslog lpr news contained skipwhite nextgroup=hapLogLvl +syn keyword hapLogFac uucp cron auth2 ftp ntp audit alert cron2 contained skipwhite nextgroup=hapLogLvl +syn keyword hapLogFac local0 local1 local2 local3 local4 local5 local6 local7 contained skipwhite nextgroup=hapLogLvl +syn keyword hapLogLvl emerg alert crit err warning notice info debug contained +syn keyword hapCookieKey rewrite insert nocache postonly indirect prefix contained skipwhite nextgroup=hapCookieKey +syn keyword hapCapture cookie contained skipwhite nextgroup=hapNameLen +syn keyword hapCapture request response contained skipwhite nextgroup=hapHeader +syn keyword hapHeader header contained skipwhite nextgroup=hapNameLen +syn keyword hapSrvKey backup cookie check inter rise fall port contained +syn keyword hapSrvKey source minconn maxconn weight usesrc contained +syn match hapStatus /\d\{3}/ contained +syn match hapStatusPath /\d\{3}/ contained skipwhite nextgroup=hapFilePath +syn match hapStatusURI /\d\{3}/ contained skipwhite nextgroup=hapURI +syn match hapIPv4Mask /\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\(\/\d\{1,2}\)\?/ contained +syn match hapLogIp /\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/ contained skipwhite nextgroup=hapLogFac +syn match hapIpPort /\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}:\d\{1,5}/ contained +syn match hapServerAd /\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\(:[+-]\?\d\{1,5}\)\?/ contained skipwhite nextgroup=hapSrvEOL +syn match hapNameLen /\S\+/ contained skipwhite nextgroup=hapLen +syn match hapCookieNam /\S\+/ contained skipwhite nextgroup=hapCookieKey +syn match hapServerN /\S\+/ contained skipwhite nextgroup=hapServerAd +syn region hapSrvEOL start=/\S/ end=/$/ contains=hapSrvKey contained + +" Brutally stolen from https://github.com/vim-perl/vim-perl: +syn match hapPerlSpecialMatch "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend +syn match hapPerlSpecialMatch "\\." extend contained contains=NONE +syn match hapPerlSpecialMatch "\\\\" contained +syn match hapPerlSpecialMatch "\\[1-9]" contained extend +syn match hapPerlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained +syn match hapPerlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained +syn match hapPerlSpecialMatch "{\d\+\%(,\%(\d\+\)\=\)\=}" contained +syn match hapPerlSpecialMatch "\[[]-]\=[^\[\]]*[]-]\=\]" contained extend +syn match hapPerlSpecialMatch "[+*()?.]" contained +syn match hapPerlSpecialMatch "(?[#:=!]" contained +syn match hapPerlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained +syn match hapPerlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained +syn match hapPerlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained + +syn region hapOneRegexpIfUnless contained start=/\S/ end=/\(\ze\s\|$\)/ skip=/\\ / contains=hapPerlSpecialMatch nextgroup=hapIfUnless,@hapNothing skipwhite +syn region hapRegSearchReplIfUnless contained start=/\S/ end=/\(\s\|$\)/ skip=/\\ / contains=hapPerlSpecialMatch nextgroup=hapRegReplIfUnless skipwhite +syn region hapRegReplIfUnless contained start=/\S/ end=/$/ contains=hapComment,hapEscape,hapPerlSpecialMatch nextgroup=hapIfUnless skipwhite +syn region hapRegexpBE contained start=/\S/ end=/\(\s\|$\)/ skip=/\\ / contains=hapPerlSpecialMatch nextgroup=hapSectLabel skipwhite + +" +" http-request +" +" http-request verbs that don't allow parameters +syn keyword hapHttpRequestVerb allow tarpit silent-drop contained skipwhite nextgroup=hapHttpIfUnless +" http-request verbs with optional parameters +syn keyword hapHttpRequestVerb auth deny contained skipwhite nextgroup=hapHttpIfUnless,hapHttpRequestParam +" http-request verbs with required parameters +syn keyword hapHttpRequestVerb redirect add-header set-header capture contained skipwhite nextgroup=hapHttpRequestParam +syn keyword hapHttpRequestVerb del-header set-nice set-log-level replace-header contained skipwhite nextgroup=hapHttpRequestParam +syn keyword hapHttpRequestVerb replace-value set-method set-path set-query contained skipwhite nextgroup=hapHttpRequestParam +syn keyword hapHttpRequestVerb set-uri set-tos set-mark contained skipwhite nextgroup=hapHttpRequestParam +" http-request verbs with both parenthetical arguments and required parameters +syn match hapHttpRequestVerb /\(add-acl\|del-acl\|del-map\|set-map\)([^)]*)/ contained skipwhite nextgroup=hapHttpRequestParam +syn match hapHttpRequestVerb /\(set-var\|unset-var\)([^)]*)/ contained skipwhite nextgroup=hapHttpRequestParam +syn match hapHttpRequestVerb /\(sc-inc-gpc0\|sc-set-gpt0\)([^)]*)/ contained skipwhite nextgroup=hapHttpRequestParam +" http-request verbs with parenthetical arguments, but without parameters +syn match hapHttpRequestVerb /\(unset-var\|sc-inc-gpc0\)([^)]*)/ contained skipwhite nextgroup=hapHttpIfUnless + +" Listed first because we want to match this rather than hapHttpRequestParam, +" which can be just about anything (including these two keywords). 'keyword' +" is actually higher priority inside the highlighter, but we'll play it extra +" safe by doing this ordering trick, too. +syn keyword hapIfUnless if unless contained skipwhite nextgroup=hapIfUnlessCond + +" A little bit of fancy footwork here, because we want to match the log-format +" parameters inside of the string separately. +syn match hapHttpRequestParam /|S\+/ contained skipwhite nextgroup=hapIfUnless,hapHttpRequestParam transparent +syn match hapHttpLogFormatStr /%\[[^][]\+\]/ contained containedin=hapHttpRequestParam +syn match hapHttpLogFormatErr /%\(\[[^][]\+\]\)\@!.*/ contained containedin=hapHttpRequestParam +syn match hapHttpRequestParamLiteral /[^%]\+/ contained containedin=hapHttpRequestParam + + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version < 508 + command -nargs=+ HiLink hi link <args> +else + command -nargs=+ HiLink hi def link <args> +endif + +HiLink hapError Error +HiLink hapNothingErr hapError +HiLink hapEscape SpecialChar +HiLink hapComment Comment +HiLink hapGreedyComment Comment +HiLink hapTodo Todo +HiLink hapSection Underlined +HiLink hapSectLabel Identifier +HiLink hapParam Keyword +HiLink hapSSLCiphers String +HiLink hapSSLCiphersError Error +HiLink hapTimeoutType hapParam + +HiLink hapOneRegexpIfUnless String +HiLink hapTwoRegexpsIfUnless hapRegexp +HiLink hapRegReplIfUnless hapRegexp +HiLink hapRegexpBE hapRegexp +HiLink hapPerlSpecialMatch Special +HiLink hapFilePath String +HiLink hapURI String +HiLink hapAbsURI hapURI +HiLink hapIp1 Number +HiLink hapIp2 hapIp1 +HiLink hapLogIp hapIp1 +HiLink hapIpPort hapIp1 +HiLink hapIPv4Mask hapIp1 +HiLink hapServerAd hapIp1 +HiLink hapStatus Number +HiLink hapStatusPath hapStatus +HiLink hapStatusURI hapStatus +HiLink hapNumber Number +HiLink hapNumberMS hapNumber +HiLink hapNumberSec hapNumber + +HiLink hapAclName Identifier +HiLink hapAclCriterion String +HiLink hapAclConverterOrNothing Special +HiLink hapAclFlag Special +HiLink hapAclFlagWithParameter Special +HiLink hapAclFlagParameter String +HiLink hapAclOperator Operator +HiLink hapAclPattern String + +HiLink hapHttpRequestVerb Operator +HiLink hapIfUnless Operator +HiLink hapHttpRequestParamLiteral String +HiLink hapHttpLogFormatStr Special +HiLink hapHttpLogFormatErr Error + +HiLink hapOption Operator +HiLink hapAppSess hapOption +HiLink hapBalance hapOption +HiLink hapCapture hapOption +HiLink hapCookieKey hapOption +HiLink hapHeader hapOption +HiLink hapGLog hapOption +HiLink hapLogFac hapOption +HiLink hapLogLvl hapOption +HiLink hapMode hapOption +HiLink hapStats hapOption +HiLink hapLen hapOption +HiLink hapSrvKey hapOption + + +delcommand HiLink + +let b:current_syntax = "haproxy" +" vim: ts=8 + +endif diff --git a/syntax/haskell.vim b/syntax/haskell.vim index 048a40ea..9ca4d89e 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -38,7 +38,8 @@ syn match haskellTypeSig \ haskellParens syn keyword haskellWhere where syn keyword haskellLet let -syn keyword haskellDeclKeyword module class instance newtype deriving in +syn match HaskellDerive "\<deriving\>\(\s\+\<\(anyclass\|instance\|newtype\|stock\)\>\)\?" +syn keyword haskellDeclKeyword module class instance newtype in syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?" syn keyword haskellDefault default syn keyword haskellImportKeywords import qualified safe as hiding contained @@ -57,6 +58,7 @@ syn match haskellImport "^\s*\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+ \ haskellType, \ haskellLineComment, \ haskellBlockComment, + \ haskellString, \ haskellPragma syn keyword haskellKeyword do case of if get(g:, 'haskell_enable_static_pointers', 0) @@ -161,11 +163,13 @@ highlight def link haskellType Type highlight def link haskellImportKeywords Include if get(g:, 'haskell_classic_highlighting', 0) highlight def link haskellDeclKeyword Keyword + highlight def link HaskellDerive Keyword highlight def link haskellDecl Keyword highlight def link haskellWhere Keyword highlight def link haskellLet Keyword else highlight def link haskellDeclKeyword Structure + highlight def link HaskellDerive Structure highlight def link haskellDecl Structure highlight def link haskellWhere Structure highlight def link haskellLet Structure diff --git a/syntax/html.vim b/syntax/html.vim index 28e09e0b..4b02bc7f 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -79,6 +79,7 @@ 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 diff --git a/syntax/javascript.vim b/syntax/javascript.vim index 34db7e29..d10f1ef5 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -151,7 +151,7 @@ syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces s syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment extend fold -syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression,jsComment extend fold +syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsComment extend fold syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword extend fold syntax region jsBlock matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsSpreadExpression extend fold syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold @@ -181,12 +181,12 @@ exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=j syntax keyword jsClassKeyword contained class syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression syntax match jsClassNoise contained /\./ -syntax match jsClassMethodType contained /\<\%([gs]et\|static\)\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsFuncName,jsClassProperty +syntax match jsClassFuncName contained /\<\K\k*\ze\s*[(<]/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowClassFunctionGroup +syntax match jsClassMethodType contained /\<\%([gs]et\|static\)\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsClassFuncName,jsClassProperty syntax region jsClassDefinition start=/\<class\>/ end=/\(\<extends\>\s\+\)\@<!{\@=/ contains=jsClassKeyword,jsExtendsKeyword,jsClassNoise,@jsExpression,jsFlowClassGroup skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup syntax match jsClassProperty contained /\<\K\k*\ze\s*=/ skipwhite skipempty nextgroup=jsClassValue,jsFlowClassDef syntax region jsClassValue contained start=/=/ end=/\_[;}]\@=/ contains=@jsExpression syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend -syntax match jsClassFuncName contained /\<\K\k*\ze\s*(/ skipwhite skipempty nextgroup=jsFuncArgs syntax region jsClassStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs " Destructuring @@ -196,7 +196,7 @@ syntax match jsDestructuringAssignment contained /\k\+\ze\s*:/ skipwhit syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend syntax match jsDestructuringNoise contained /[,[\]]/ -syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold +syntax region jsDestructuringPropertyComputed contained matchgroup=jsDestructuringBraces start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringValueAssignment,jsDestructuringNoise extend fold " Comments syntax keyword jsCommentTodo contained TODO FIXME XXX TBD diff --git a/syntax/jinja2.vim b/syntax/jinja2.vim index 3ddea85c..55d9fbfd 100644 --- a/syntax/jinja2.vim +++ b/syntax/jinja2.vim @@ -1,44 +1,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 " Vim syntax file -" Language: Jinja template -" Maintainer: Armin Ronacher <armin.ronacher@active-4.com> -" Last Change: 2008 May 9 -" Version: 1.1 -" -" Known Bugs: -" because of odd limitations dicts and the modulo operator -" appear wrong in the template. -" -" Changes: -" -" 2008 May 9: Added support for Jinja2 changes (new keyword rules) - -" .vimrc variable to disable html highlighting -if !exists('g:jinja_syntax_html') - let g:jinja_syntax_html=1 -endif +" Language: Jinja2 - with special modifications for compound-filetype +" compatibility +" Maintainer: Dave Honneffer <pearofducks@gmail.com> +" Last Change: 2018.02.11 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif - let main_syntax = 'jinja' + let main_syntax = 'jinja2' endif -" Pull in the HTML syntax. -if g:jinja_syntax_html - if version < 600 - so <sfile>:p:h/html.vim - else - runtime! syntax/html.vim - unlet b:current_syntax - endif -endif +let b:current_syntax = '' +unlet b:current_syntax syntax case match @@ -95,15 +68,8 @@ syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\ " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_jinja_syn_inits") - if version < 508 - let did_jinja_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif +if !exists("did_jinja_syn_inits") + command -nargs=+ HiLink hi def link <args> HiLink jinjaPunctuation jinjaOperator HiLink jinjaAttribute jinjaVariable @@ -130,10 +96,6 @@ if version >= 508 || !exists("did_jinja_syn_inits") delcommand HiLink endif -let b:current_syntax = "jinja" - -if main_syntax == 'jinja' - unlet main_syntax -endif +let b:current_syntax = "jinja2" endif diff --git a/syntax/julia.vim b/syntax/julia.vim index e7bf145c..3e5c1433 100644 --- a/syntax/julia.vim +++ b/syntax/julia.vim @@ -112,13 +112,13 @@ else endif syntax cluster juliaTypesItemsAll contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther syntax cluster juliaTypesItems05 contains=juliaBaseTypeIter05,juliaBaseTypeRange05 -syntax cluster juliaTypesItems0506 contains=juliaBaseTypeNum0506,juliaBaseTypeRange0506,juliaBaseTypeSet0506 +syntax cluster juliaTypesItems0506 contains=juliaBaseTypeNum0506,juliaBaseTypeRange0506,juliaBaseTypeDict0506,juliaBaseTypeSet0506 syntax cluster juliaTypesItems0607 contains=juliaBaseTypeBasic0607,juliaBaseTypeArray0607,juliaBaseTypeSet0607,juliaBaseTypeProcess0607,juliaBaseTypeRange0607,juliaBaseTypeTime0607 -syntax cluster juliaTypesItems07 contains=juliaBaseTypeBasic07,juliaBaseTypeNum07,juliaBaseTypeError07,juliaBaseTypeIter07,juliaBaseTypeRange07,juliaBaseTypeArray07,juliaBaseTypeSet07,juliaBaseTypeC07,juliaBaseTypeDisplay07,juliaBaseTypeIO07 +syntax cluster juliaTypesItems07 contains=juliaBaseTypeBasic07,juliaBaseTypeNum07,juliaBaseTypeError07,juliaBaseTypeIter07,juliaBaseTypeRange07,juliaBaseTypeArray07,juliaBaseTypeDict07,juliaBaseTypeSet07,juliaBaseTypeC07,juliaBaseTypeDisplay07,juliaBaseTypeIO07 -syntax cluster juliaConstItemsAll contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstIO,juliaConstMMap,juliaConstC,juliaConstGeneric -syntax cluster juliaConstItems0506 contains=juliaConstNum0506 -syntax cluster juliaConstItems07 contains=juliaConstGeneric07,juliaPossibleEuler +syntax cluster juliaConstItemsAll contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric +syntax cluster juliaConstItems0506 contains=juliaConstNum0506,juliaConstIO0506 +syntax cluster juliaConstItems07 contains=juliaConstGeneric07,juliaPossibleEuler,juliaConstEnv07,juliaConstIO07 if b:julia_syntax_version <= 6 syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems0506 else @@ -223,7 +223,9 @@ syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abs syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|SparseVector\|VecElement\)\>" syntax match juliaBaseTypeArray0607 display "\<\%(Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|RowVector\)\>" syntax match juliaBaseTypeArray07 display "\<\%(BroadcastStyle\|Adjoint\|Transpose\|LinearIndices\)\>" -syntax match juliaBaseTypeDict display "\<\%(WeakKey\|ObjectId\)\?Dict\>" +syntax match juliaBaseTypeDict display "\<\%(WeakKey\)\?Dict\>" +syntax match juliaBaseTypeDict0506 display "\<ObjectIdDict\>" +syntax match juliaBaseTypeDict07 display "\<IdDict\>" syntax match juliaBaseTypeSet display "\<Set\>" syntax match juliaBaseTypeSet0506 display "\<IntSet\>" syntax match juliaBaseTypeSet0607 display "\<AbstractSet\>" @@ -236,7 +238,7 @@ syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Ordinal\|St syntax match juliaBaseTypeRange05 display "\<FloatRange\>" syntax match juliaBaseTypeRange0506 display "\<Range\>" syntax match juliaBaseTypeRange0607 display "\<\%(ExponentialBackOff\|StepRangeLen\)\>" -syntax match juliaBaseTypeRange07 display "\<AbstractRange\>" +syntax match juliaBaseTypeRange07 display "\<\(Abstract\|Lin\)Range\>" syntax match juliaBaseTypeRegex display "\<Regex\%(Match\)\?\>" syntax match juliaBaseTypeFact display "\<Factorization\>" syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>" @@ -259,8 +261,10 @@ syntax match juliaConstNum0506 display "\%(\<\%(eu\?\|eulergamma\|γ\|catalan\ syntax match juliaPossibleEuler "ℯ" contains=juliaEuler exec 'syntax match juliaEuler contained "\%(\%(^\|[' . s:nonidS_chars . ']\|' . s:operators . '\)\%([.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze\%($\|[' . s:nonidS_chars . ']\|' . s:operators . '\)"' syntax match juliaConstBool display "\<\%(true\|false\)\>" -syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|CPU_CORES\|OS_NAME\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|JULIA_HOME\|PROGRAM_FILE\)\>" -syntax match juliaConstIO display "\<\%(STD\%(OUT\|IN\|ERR\)\|DevNull\)\>" +syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|OS_NAME\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|JULIA_HOME\|PROGRAM_FILE\)\>" +syntax match juliaConstEnv07 display "\<DEPOT_PATH\>" +syntax match juliaConstIO0506 display "\<\%(STD\%(OUT\|IN\|ERR\)\|DevNull\)\>" +syntax match juliaConstIO07 display "\<\%(std\%(out\|in\|err\)\|devnull\)\>" syntax match juliaConstC display "\<\%(WORD_SIZE\|C_NULL\)\>" syntax match juliaConstGeneric display "\<\%(nothing\|Main\)\>" syntax match juliaConstGeneric07 display "\<missing\>" @@ -452,11 +456,11 @@ for t in ["Iter", "Range"] let h = b:julia_syntax_version == 5 ? "Type" : b:julia_syntax_version == 6 ? "juliaDeprecated" : "NONE" exec "hi! def link juliaBaseType" . t . "05 " . h endfor -for t in ["Num", "Range", "Set"] +for t in ["Num", "Range", "Dict", "Set"] let h = b:julia_syntax_version <= 6 ? "Type" : "juliaDeprecated" exec "hi! def link juliaBaseType" . t . "0506 " . h endfor -for t in ["Range", "Set", "Basic", "C", "Array", "Iter", "Display", "IO", "Num", "Error"] +for t in ["Range", "Dict", "Set", "Basic", "C", "Array", "Iter", "Display", "IO", "Num", "Error"] let h = b:julia_syntax_version >= 7 ? "Type" : "NONE" exec "hi! def link juliaBaseType" . t . "07 " . h endfor @@ -472,15 +476,18 @@ let h = b:julia_syntax_version >= 7 ? "Constant" : "NONE" exec "hi! def link juliaEuler " . h hi def link juliaConstEnv Constant -hi def link juliaConstIO Constant hi def link juliaConstC Constant hi def link juliaConstLimits Constant hi def link juliaConstGeneric Constant hi def link juliaRangeEnd Constant hi def link juliaConstBool Boolean -let h = b:julia_syntax_version >= 7 ? "Constant" : "NONE" -exec "hi! def link juliaConstGeneric07 " . h +for t in ["Generic", "IO", "Env"] + let h = b:julia_syntax_version >= 7 ? "Constant" : "NONE" + exec "hi! def link juliaConst" . t . "07 " . h +endfor +let h = b:julia_syntax_version < 7 ? "Constant" : "juliaDeprecated" +exec "hi! def link juliaConstIO0506 " . h hi def link juliaComprehensionFor Keyword hi def link juliaComprehensionIf Keyword diff --git a/syntax/nim.vim b/syntax/nim.vim index fe7944cb..d69166b3 100644 --- a/syntax/nim.vim +++ b/syntax/nim.vim @@ -84,10 +84,16 @@ syn match nimEscapeError "\\x\x\=\X" display contained if nim_highlight_numbers == 1 " numbers (including longs and complex) - syn match nimNumber "\v<0x\x+(\'(i|I|f|F|u|U)(8|16|32|64))?>" - syn match nimNumber "\v<[0-9_]+(\'(i|I|f|F|u|U)(8|16|32|64))?>" - syn match nimNumber "\v[0-9]\.[0-9_]+([eE][+-]=[0-9_]+)=>" - syn match nimNumber "\v<[0-9_]+(\.[0-9_]+)?([eE][+-]?[0-9_]+)?(\'(f|F)(32|64))?>" + let s:dec_num = '\d%(_?\d)*' + let s:int_suf = '%(''%(%(i|I|u|U)%(8|16|32|64)|u|U))' + let s:float_suf = '%(''%(%(f|F)%(32|64|128)?|d|D))' + let s:exp = '%([eE][+-]?'.s:dec_num.')' + exe 'syn match nimNumber /\v<0[bB][01]%(_?[01])*%('.s:int_suf.'|'.s:float_suf.')?>/' + exe 'syn match nimNumber /\v<0[ocC]\o%(_?\o)*%('.s:int_suf.'|'.s:float_suf.')?>/' + exe 'syn match nimNumber /\v<0[xX]\x%(_?\x)*%('.s:int_suf.'|'.s:float_suf.')?>/' + exe 'syn match nimNumber /\v<'.s:dec_num.'%('.s:int_suf.'|'.s:exp.'?'.s:float_suf.'?)>/' + exe 'syn match nimNumber /\v<'.s:dec_num.'\.'.s:dec_num.s:exp.'?'.s:float_suf.'?>/' + unlet s:dec_num s:int_suf s:float_suf s:exp endif if nim_highlight_builtins == 1 diff --git a/syntax/nix.vim b/syntax/nix.vim index ee0f4173..d0dc57cb 100644 --- a/syntax/nix.vim +++ b/syntax/nix.vim @@ -36,11 +36,12 @@ syn region nixComment start=+/\*+ end=+\*/+ contains=nixTodo,@Spell syn region nixInterpolation matchgroup=nixInterpolationDelimiter start="\${" end="}" contained contains=@nixExpr,nixInterpolationParam -syn match nixSimpleStringSpecial /\\["nrt\\$]/ contained -syn match nixInterpolationSpecial /''['$]/ contained +syn match nixSimpleStringSpecial /\\./ contained +syn match nixStringSpecial /''['$]/ contained +syn match nixStringSpecial /''\\./ contained syn region nixSimpleString matchgroup=nixStringDelimiter start=+"+ skip=+\\"+ end=+"+ contains=nixInterpolation,nixSimpleStringSpecial -syn region nixString matchgroup=nixStringDelimiter start=+''+ skip=+''['$]+ end=+''+ contains=nixInterpolation,nixInterpolationSpecial +syn region nixString matchgroup=nixStringDelimiter start=+''+ skip=+''['$\\]+ end=+''+ contains=nixInterpolation,nixStringSpecial syn match nixFunctionCall "[a-zA-Z_][a-zA-Z0-9_'-]*" @@ -117,27 +118,34 @@ syn region nixWithExpr matchgroup=nixWithExprKeyword start="\<with\>" matchgroup syn region nixAssertExpr matchgroup=nixAssertKeyword start="\<assert\>" matchgroup=NONE end=";" contains=@nixExpr -syn cluster nixExpr contains=nixBoolean,nixNull,nixOperator,nixParen,nixInteger,nixRecKeyword,nixConditional,nixBuiltin,nixSimpleBuiltin,nixComment,nixFunctionCall,nixFunctionArgument,nixSimpleFunctionArgument,nixPath,nixHomePath,nixSearchPathRef,nixURI,nixAttributeSet,nixList,nixSimpleString,nixString,nixLetExpr,nixIfExpr,nixWithExpr,nixAssertExpr +syn cluster nixExpr contains=nixBoolean,nixNull,nixOperator,nixParen,nixInteger,nixRecKeyword,nixConditional,nixBuiltin,nixSimpleBuiltin,nixComment,nixFunctionCall,nixFunctionArgument,nixSimpleFunctionArgument,nixPath,nixHomePath,nixSearchPathRef,nixURI,nixAttributeSet,nixList,nixSimpleString,nixString,nixLetExpr,nixIfExpr,nixWithExpr,nixAssertExpr,nixInterpolation " These definitions override @nixExpr and have to come afterwards: syn match nixInterpolationParam "[a-zA-Z_][a-zA-Z0-9_'-]*\%(\.[a-zA-Z_][a-zA-Z0-9_'-]*\)*" contained -" Non-namespaced Nix builtins as of version 1.10: +" Non-namespaced Nix builtins as of version 2.0: syn keyword nixSimpleBuiltin - \ abort baseNameOf derivation dirOf fetchTarball import map removeAttrs - \ throw toString + \ abort baseNameOf derivation derivationStrict dirOf fetchGit + \ fetchMercurial fetchTarball import isNull map placeholder removeAttrs + \ scopedImport throw toString -" Namespaced and non-namespaced Nix builtins as of version 1.10: + +" Namespaced and non-namespaced Nix builtins as of version 2.0: syn keyword nixNamespacedBuiltin contained - \ abort add all any attrNames attrValues baseNameOf compareVersions - \ concatLists currentSystem deepSeq derivation dirOf div elem elemAt - \ fetchTarball fetchurl filter filterSource foldl' fromJSON genList - \ getAttr getEnv hasAttr hashString head import intersectAttrs isAttrs - \ isBool isFunction isInt isList isString length lessThan listToAttrs map - \ mul parseDrvName pathExists readDir readFile removeAttrs replaceStrings - \ seq sort stringLength sub substring tail throw toFile toJSON toPath - \ toString toXML trace typeOf + \ abort add addErrorContext all any attrNames attrValues baseNameOf + \ catAttrs compareVersions concatLists concatStringsSep currentSystem + \ currentTime deepSeq derivation derivationStrict dirOf div elem elemAt + \ fetchGit fetchMercurial fetchTarball fetchurl filter \ filterSource + \ findFile foldl' fromJSON functionArgs genList \ genericClosure getAttr + \ getEnv hasAttr hasContext hashString head import intersectAttrs isAttrs + \ isBool isFloat isFunction isInt isList isNull isString langVersion + \ length lessThan listToAttrs map match mul nixPath nixVersion + \ parseDrvName partition path pathExists placeholder readDir readFile + \ removeAttrs replaceStrings scopedImport seq sort split splitVersion + \ storeDir storePath stringLength sub substring tail throw toFile toJSON + \ toPath toString toXML trace tryEval typeOf unsafeDiscardOutputDependency + \ unsafeDiscardStringContext unsafeGetAttrPos valueSize syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin @@ -158,7 +166,6 @@ hi def link nixInteger Integer hi def link nixInterpolation Macro hi def link nixInterpolationDelimiter Delimiter hi def link nixInterpolationParam Macro -hi def link nixInterpolationSpecial Special hi def link nixLetExprKeyword Keyword hi def link nixNamespacedBuiltin Special hi def link nixNull Constant @@ -173,6 +180,7 @@ hi def link nixSimpleString String hi def link nixSimpleStringSpecial SpecialChar hi def link nixString String hi def link nixStringDelimiter Delimiter +hi def link nixStringSpecial Special hi def link nixTodo Todo hi def link nixURI Include hi def link nixWithExprKeyword Keyword diff --git a/syntax/php.vim b/syntax/php.vim index 7276ef00..e04af879 100644 --- a/syntax/php.vim +++ b/syntax/php.vim @@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'php') == -1 " " {{{ BLOCK: Last-modified -" Thu, 05 Jan 2017 09:58:17 +0000, PHP 7.1.0-3+deb.sury.org~trusty+1 +" Mon, 09 Apr 2018 08:49:14 +0000, PHP 7.2.2-1+ubuntu14.04.1+deb.sury.org+1 " }}} " @@ -208,7 +208,7 @@ endif syn case match if index(g:php_syntax_extensions_enabled, "core") >= 0 && index(g:php_syntax_extensions_disabled, "core") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "core") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "core") < 0) " Core constants -syn keyword phpConstants DEBUG_BACKTRACE_IGNORE_ARGS DEBUG_BACKTRACE_PROVIDE_OBJECT DEFAULT_INCLUDE_PATH E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_BINARY PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_DEBUG PHP_EOL PHP_EXTENSION_DIR PHP_EXTRA_VERSION PHP_FD_SETSIZE PHP_INT_MAX PHP_INT_MIN PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_MAJOR_VERSION PHP_MANDIR PHP_MAXPATHLEN PHP_MINOR_VERSION PHP_OS PHP_OUTPUT_HANDLER_CLEAN PHP_OUTPUT_HANDLER_CLEANABLE PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_DISABLED PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL PHP_OUTPUT_HANDLER_FLUSH PHP_OUTPUT_HANDLER_FLUSHABLE PHP_OUTPUT_HANDLER_REMOVABLE PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_STARTED PHP_OUTPUT_HANDLER_STDFLAGS PHP_OUTPUT_HANDLER_WRITE PHP_PREFIX PHP_RELEASE_VERSION PHP_SAPI PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_VERSION PHP_VERSION_ID PHP_ZTS STDERR STDIN STDOUT UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_EXTENSION UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL ZEND_DEBUG_BUILD ZEND_THREAD_SAFE contained +syn keyword phpConstants DEBUG_BACKTRACE_IGNORE_ARGS DEBUG_BACKTRACE_PROVIDE_OBJECT DEFAULT_INCLUDE_PATH E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_BINARY PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_DEBUG PHP_EOL PHP_EXTENSION_DIR PHP_EXTRA_VERSION PHP_FD_SETSIZE PHP_FLOAT_DIG PHP_FLOAT_EPSILON PHP_FLOAT_MAX PHP_FLOAT_MIN PHP_INT_MAX PHP_INT_MIN PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_MAJOR_VERSION PHP_MANDIR PHP_MAXPATHLEN PHP_MINOR_VERSION PHP_OS PHP_OS_FAMILY PHP_OUTPUT_HANDLER_CLEAN PHP_OUTPUT_HANDLER_CLEANABLE PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_DISABLED PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL PHP_OUTPUT_HANDLER_FLUSH PHP_OUTPUT_HANDLER_FLUSHABLE PHP_OUTPUT_HANDLER_REMOVABLE PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_STARTED PHP_OUTPUT_HANDLER_STDFLAGS PHP_OUTPUT_HANDLER_WRITE PHP_PREFIX PHP_RELEASE_VERSION PHP_SAPI PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_VERSION PHP_VERSION_ID PHP_ZTS STDERR STDIN STDOUT UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_EXTENSION UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL ZEND_DEBUG_BUILD ZEND_THREAD_SAFE contained endif if index(g:php_syntax_extensions_enabled, "curl") >= 0 && index(g:php_syntax_extensions_disabled, "curl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "curl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "curl") < 0) " curl constants @@ -216,7 +216,7 @@ syn keyword phpConstants CURLAUTH_ANY CURLAUTH_ANYSAFE CURLAUTH_BASIC CURLAUTH_D endif if index(g:php_syntax_extensions_enabled, "date") >= 0 && index(g:php_syntax_extensions_disabled, "date") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "date") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "date") < 0) " date constants -syn keyword phpConstants AFRICA ALL ALL_WITH_BC AMERICA ANTARCTICA ARCTIC ASIA ATLANTIC ATOM AUSTRALIA COOKIE DATE_ATOM DATE_COOKIE DATE_ISO8601 DATE_RFC822 DATE_RFC850 DATE_RFC1036 DATE_RFC1123 DATE_RFC2822 DATE_RFC3339 DATE_RFC3339_EXTENDED DATE_RSS DATE_W3C EUROPE EXCLUDE_START_DATE INDIAN ISO8601 PACIFIC PER_COUNTRY RFC822 RFC850 RFC1036 RFC1123 RFC2822 RFC3339 RFC3339_EXTENDED RSS SUNFUNCS_RET_DOUBLE SUNFUNCS_RET_STRING SUNFUNCS_RET_TIMESTAMP UTC W3C contained +syn keyword phpConstants AFRICA ALL ALL_WITH_BC AMERICA ANTARCTICA ARCTIC ASIA ATLANTIC ATOM AUSTRALIA COOKIE DATE_ATOM DATE_COOKIE DATE_ISO8601 DATE_RFC822 DATE_RFC850 DATE_RFC1036 DATE_RFC1123 DATE_RFC2822 DATE_RFC3339 DATE_RFC3339_EXTENDED DATE_RFC7231 DATE_RSS DATE_W3C EUROPE EXCLUDE_START_DATE INDIAN ISO8601 PACIFIC PER_COUNTRY RFC822 RFC850 RFC1036 RFC1123 RFC2822 RFC3339 RFC3339_EXTENDED RFC7231 RSS SUNFUNCS_RET_DOUBLE SUNFUNCS_RET_STRING SUNFUNCS_RET_TIMESTAMP UTC W3C contained endif if index(g:php_syntax_extensions_enabled, "dom") >= 0 && index(g:php_syntax_extensions_disabled, "dom") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "dom") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "dom") < 0) " dom constants @@ -224,7 +224,7 @@ syn keyword phpConstants DOMSTRING_SIZE_ERR DOM_HIERARCHY_REQUEST_ERR DOM_INDEX_ endif if index(g:php_syntax_extensions_enabled, "gd") >= 0 && index(g:php_syntax_extensions_disabled, "gd") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "gd") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "gd") < 0) " gd constants -syn keyword phpConstants GD_BUNDLED GD_EXTRA_VERSION GD_MAJOR_VERSION GD_MINOR_VERSION GD_RELEASE_VERSION GD_VERSION IMG_AFFINE_ROTATE IMG_AFFINE_SCALE IMG_AFFINE_SHEAR_HORIZONTAL IMG_AFFINE_SHEAR_VERTICAL IMG_AFFINE_TRANSLATE IMG_ARC_CHORD IMG_ARC_EDGED IMG_ARC_NOFILL IMG_ARC_PIE IMG_ARC_ROUNDED IMG_BELL IMG_BESSEL IMG_BICUBIC IMG_BICUBIC_FIXED IMG_BILINEAR_FIXED IMG_BLACKMAN IMG_BOX IMG_BSPLINE IMG_CATMULLROM IMG_COLOR_BRUSHED IMG_COLOR_STYLED IMG_COLOR_STYLEDBRUSHED IMG_COLOR_TILED IMG_COLOR_TRANSPARENT IMG_CROP_BLACK IMG_CROP_DEFAULT IMG_CROP_SIDES IMG_CROP_THRESHOLD IMG_CROP_TRANSPARENT IMG_CROP_WHITE IMG_EFFECT_ALPHABLEND IMG_EFFECT_NORMAL IMG_EFFECT_OVERLAY IMG_EFFECT_REPLACE IMG_FILTER_BRIGHTNESS IMG_FILTER_COLORIZE IMG_FILTER_CONTRAST IMG_FILTER_EDGEDETECT IMG_FILTER_EMBOSS IMG_FILTER_GAUSSIAN_BLUR IMG_FILTER_GRAYSCALE IMG_FILTER_MEAN_REMOVAL IMG_FILTER_NEGATE IMG_FILTER_PIXELATE IMG_FILTER_SELECTIVE_BLUR IMG_FILTER_SMOOTH IMG_FLIP_BOTH IMG_FLIP_HORIZONTAL IMG_FLIP_VERTICAL IMG_GAUSSIAN IMG_GD2_COMPRESSED IMG_GD2_RAW IMG_GENERALIZED_CUBIC IMG_GIF IMG_HAMMING IMG_HANNING IMG_HERMITE IMG_JPEG IMG_JPG IMG_MITCHELL IMG_NEAREST_NEIGHBOUR IMG_PNG IMG_POWER IMG_QUADRATIC IMG_SINC IMG_TRIANGLE IMG_WBMP IMG_WEBP IMG_WEIGHTED4 IMG_XPM PNG_ALL_FILTERS PNG_FILTER_AVG PNG_FILTER_NONE PNG_FILTER_PAETH PNG_FILTER_SUB PNG_FILTER_UP PNG_NO_FILTER contained +syn keyword phpConstants GD_BUNDLED GD_EXTRA_VERSION GD_MAJOR_VERSION GD_MINOR_VERSION GD_RELEASE_VERSION GD_VERSION IMG_AFFINE_ROTATE IMG_AFFINE_SCALE IMG_AFFINE_SHEAR_HORIZONTAL IMG_AFFINE_SHEAR_VERTICAL IMG_AFFINE_TRANSLATE IMG_ARC_CHORD IMG_ARC_EDGED IMG_ARC_NOFILL IMG_ARC_PIE IMG_ARC_ROUNDED IMG_BELL IMG_BESSEL IMG_BICUBIC IMG_BICUBIC_FIXED IMG_BILINEAR_FIXED IMG_BLACKMAN IMG_BMP IMG_BOX IMG_BSPLINE IMG_CATMULLROM IMG_COLOR_BRUSHED IMG_COLOR_STYLED IMG_COLOR_STYLEDBRUSHED IMG_COLOR_TILED IMG_COLOR_TRANSPARENT IMG_CROP_BLACK IMG_CROP_DEFAULT IMG_CROP_SIDES IMG_CROP_THRESHOLD IMG_CROP_TRANSPARENT IMG_CROP_WHITE IMG_EFFECT_ALPHABLEND IMG_EFFECT_MULTIPLY IMG_EFFECT_NORMAL IMG_EFFECT_OVERLAY IMG_EFFECT_REPLACE IMG_FILTER_BRIGHTNESS IMG_FILTER_COLORIZE IMG_FILTER_CONTRAST IMG_FILTER_EDGEDETECT IMG_FILTER_EMBOSS IMG_FILTER_GAUSSIAN_BLUR IMG_FILTER_GRAYSCALE IMG_FILTER_MEAN_REMOVAL IMG_FILTER_NEGATE IMG_FILTER_PIXELATE IMG_FILTER_SELECTIVE_BLUR IMG_FILTER_SMOOTH IMG_FLIP_BOTH IMG_FLIP_HORIZONTAL IMG_FLIP_VERTICAL IMG_GAUSSIAN IMG_GD2_COMPRESSED IMG_GD2_RAW IMG_GENERALIZED_CUBIC IMG_GIF IMG_HAMMING IMG_HANNING IMG_HERMITE IMG_JPEG IMG_JPG IMG_MITCHELL IMG_NEAREST_NEIGHBOUR IMG_PNG IMG_POWER IMG_QUADRATIC IMG_SINC IMG_TRIANGLE IMG_WBMP IMG_WEBP IMG_WEIGHTED4 IMG_XPM PNG_ALL_FILTERS PNG_FILTER_AVG PNG_FILTER_NONE PNG_FILTER_PAETH PNG_FILTER_SUB PNG_FILTER_UP PNG_NO_FILTER contained endif if index(g:php_syntax_extensions_enabled, "hash") >= 0 && index(g:php_syntax_extensions_disabled, "hash") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "hash") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "hash") < 0) " hash constants @@ -236,7 +236,7 @@ syn keyword phpConstants ICONV_IMPL ICONV_MIME_DECODE_CONTINUE_ON_ERROR ICONV_MI endif if index(g:php_syntax_extensions_enabled, "json") >= 0 && index(g:php_syntax_extensions_disabled, "json") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "json") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "json") < 0) " json constants -syn keyword phpConstants JSON_BIGINT_AS_STRING JSON_ERROR_CTRL_CHAR JSON_ERROR_DEPTH JSON_ERROR_INF_OR_NAN JSON_ERROR_INVALID_PROPERTY_NAME JSON_ERROR_NONE JSON_ERROR_RECURSION JSON_ERROR_STATE_MISMATCH JSON_ERROR_SYNTAX JSON_ERROR_UNSUPPORTED_TYPE JSON_ERROR_UTF8 JSON_ERROR_UTF16 JSON_FORCE_OBJECT JSON_HEX_AMP JSON_HEX_APOS JSON_HEX_QUOT JSON_HEX_TAG JSON_NUMERIC_CHECK JSON_OBJECT_AS_ARRAY JSON_PARTIAL_OUTPUT_ON_ERROR JSON_PRESERVE_ZERO_FRACTION JSON_PRETTY_PRINT JSON_UNESCAPED_LINE_TERMINATORS JSON_UNESCAPED_SLASHES JSON_UNESCAPED_UNICODE contained +syn keyword phpConstants JSON_BIGINT_AS_STRING JSON_ERROR_CTRL_CHAR JSON_ERROR_DEPTH JSON_ERROR_INF_OR_NAN JSON_ERROR_INVALID_PROPERTY_NAME JSON_ERROR_NONE JSON_ERROR_RECURSION JSON_ERROR_STATE_MISMATCH JSON_ERROR_SYNTAX JSON_ERROR_UNSUPPORTED_TYPE JSON_ERROR_UTF8 JSON_ERROR_UTF16 JSON_FORCE_OBJECT JSON_HEX_AMP JSON_HEX_APOS JSON_HEX_QUOT JSON_HEX_TAG JSON_INVALID_UTF8_IGNORE JSON_INVALID_UTF8_SUBSTITUTE JSON_NUMERIC_CHECK JSON_OBJECT_AS_ARRAY JSON_PARTIAL_OUTPUT_ON_ERROR JSON_PRESERVE_ZERO_FRACTION JSON_PRETTY_PRINT JSON_UNESCAPED_LINE_TERMINATORS JSON_UNESCAPED_SLASHES JSON_UNESCAPED_UNICODE contained endif if index(g:php_syntax_extensions_enabled, "libxml") >= 0 && index(g:php_syntax_extensions_disabled, "libxml") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "libxml") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "libxml") < 0) " libxml constants @@ -256,19 +256,19 @@ syn keyword phpConstants MYSQL_ASSOC MYSQL_BOTH MYSQL_CLIENT_COMPRESS MYSQL_CLIE endif if index(g:php_syntax_extensions_enabled, "mysqli") >= 0 && index(g:php_syntax_extensions_disabled, "mysqli") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "mysqli") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "mysqli") < 0) " mysqli constants -syn keyword phpConstants MYSQLI_ASSOC MYSQLI_ASYNC MYSQLI_AUTO_INCREMENT_FLAG MYSQLI_BINARY_FLAG MYSQLI_BLOB_FLAG MYSQLI_BOTH MYSQLI_CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS MYSQLI_CLIENT_COMPRESS MYSQLI_CLIENT_FOUND_ROWS MYSQLI_CLIENT_IGNORE_SPACE MYSQLI_CLIENT_INTERACTIVE MYSQLI_CLIENT_NO_SCHEMA MYSQLI_CLIENT_SSL MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT MYSQLI_CURSOR_TYPE_FOR_UPDATE MYSQLI_CURSOR_TYPE_NO_CURSOR MYSQLI_CURSOR_TYPE_READ_ONLY MYSQLI_CURSOR_TYPE_SCROLLABLE MYSQLI_DATA_TRUNCATED MYSQLI_DEBUG_TRACE_ENABLED MYSQLI_ENUM_FLAG MYSQLI_GROUP_FLAG MYSQLI_INIT_COMMAND MYSQLI_MULTIPLE_KEY_FLAG MYSQLI_NOT_NULL_FLAG MYSQLI_NO_DATA MYSQLI_NO_DEFAULT_VALUE_FLAG MYSQLI_NUM MYSQLI_NUM_FLAG MYSQLI_ON_UPDATE_NOW_FLAG MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS MYSQLI_OPT_CONNECT_TIMEOUT MYSQLI_OPT_INT_AND_FLOAT_NATIVE MYSQLI_OPT_LOCAL_INFILE MYSQLI_OPT_NET_CMD_BUFFER_SIZE MYSQLI_OPT_NET_READ_BUFFER_SIZE MYSQLI_OPT_SSL_VERIFY_SERVER_CERT MYSQLI_PART_KEY_FLAG MYSQLI_PRI_KEY_FLAG MYSQLI_READ_DEFAULT_FILE MYSQLI_READ_DEFAULT_GROUP MYSQLI_REFRESH_BACKUP_LOG MYSQLI_REFRESH_GRANT MYSQLI_REFRESH_HOSTS MYSQLI_REFRESH_LOG MYSQLI_REFRESH_MASTER MYSQLI_REFRESH_SLAVE MYSQLI_REFRESH_STATUS MYSQLI_REFRESH_TABLES MYSQLI_REFRESH_THREADS MYSQLI_REPORT_ALL MYSQLI_REPORT_ERROR MYSQLI_REPORT_INDEX MYSQLI_REPORT_OFF MYSQLI_REPORT_STRICT MYSQLI_SERVER_PS_OUT_PARAMS MYSQLI_SERVER_PUBLIC_KEY MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED MYSQLI_SERVER_QUERY_NO_INDEX_USED MYSQLI_SERVER_QUERY_WAS_SLOW MYSQLI_SET_CHARSET_DIR MYSQLI_SET_CHARSET_NAME MYSQLI_SET_FLAG MYSQLI_STMT_ATTR_CURSOR_TYPE MYSQLI_STMT_ATTR_PREFETCH_ROWS MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH MYSQLI_STORE_RESULT MYSQLI_STORE_RESULT_COPY_DATA MYSQLI_TIMESTAMP_FLAG MYSQLI_TRANS_COR_AND_CHAIN MYSQLI_TRANS_COR_AND_NO_CHAIN MYSQLI_TRANS_COR_NO_RELEASE MYSQLI_TRANS_COR_RELEASE MYSQLI_TRANS_START_READ_ONLY MYSQLI_TRANS_START_READ_WRITE MYSQLI_TRANS_START_WITH_CONSISTENT_SNAPSHOT MYSQLI_TYPE_BIT MYSQLI_TYPE_BLOB MYSQLI_TYPE_CHAR MYSQLI_TYPE_DATE MYSQLI_TYPE_DATETIME MYSQLI_TYPE_DECIMAL MYSQLI_TYPE_DOUBLE MYSQLI_TYPE_ENUM MYSQLI_TYPE_FLOAT MYSQLI_TYPE_GEOMETRY MYSQLI_TYPE_INT24 MYSQLI_TYPE_INTERVAL MYSQLI_TYPE_JSON MYSQLI_TYPE_LONG MYSQLI_TYPE_LONGLONG MYSQLI_TYPE_LONG_BLOB MYSQLI_TYPE_MEDIUM_BLOB MYSQLI_TYPE_NEWDATE MYSQLI_TYPE_NEWDECIMAL MYSQLI_TYPE_NULL MYSQLI_TYPE_SET MYSQLI_TYPE_SHORT MYSQLI_TYPE_STRING MYSQLI_TYPE_TIME MYSQLI_TYPE_TIMESTAMP MYSQLI_TYPE_TINY MYSQLI_TYPE_TINY_BLOB MYSQLI_TYPE_VAR_STRING MYSQLI_TYPE_YEAR MYSQLI_UNIQUE_KEY_FLAG MYSQLI_UNSIGNED_FLAG MYSQLI_USE_RESULT MYSQLI_ZEROFILL_FLAG contained +syn keyword phpConstants MYSQLI_ASSOC MYSQLI_ASYNC MYSQLI_AUTO_INCREMENT_FLAG MYSQLI_BINARY_FLAG MYSQLI_BLOB_FLAG MYSQLI_BOTH MYSQLI_CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS MYSQLI_CLIENT_COMPRESS MYSQLI_CLIENT_FOUND_ROWS MYSQLI_CLIENT_IGNORE_SPACE MYSQLI_CLIENT_INTERACTIVE MYSQLI_CLIENT_NO_SCHEMA MYSQLI_CLIENT_SSL MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT MYSQLI_CURSOR_TYPE_FOR_UPDATE MYSQLI_CURSOR_TYPE_NO_CURSOR MYSQLI_CURSOR_TYPE_READ_ONLY MYSQLI_CURSOR_TYPE_SCROLLABLE MYSQLI_DATA_TRUNCATED MYSQLI_DEBUG_TRACE_ENABLED MYSQLI_ENUM_FLAG MYSQLI_GROUP_FLAG MYSQLI_INIT_COMMAND MYSQLI_MULTIPLE_KEY_FLAG MYSQLI_NOT_NULL_FLAG MYSQLI_NO_DATA MYSQLI_NO_DEFAULT_VALUE_FLAG MYSQLI_NUM MYSQLI_NUM_FLAG MYSQLI_ON_UPDATE_NOW_FLAG MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS MYSQLI_OPT_CONNECT_TIMEOUT MYSQLI_OPT_INT_AND_FLOAT_NATIVE MYSQLI_OPT_LOCAL_INFILE MYSQLI_OPT_NET_CMD_BUFFER_SIZE MYSQLI_OPT_NET_READ_BUFFER_SIZE MYSQLI_OPT_READ_TIMEOUT MYSQLI_OPT_SSL_VERIFY_SERVER_CERT MYSQLI_PART_KEY_FLAG MYSQLI_PRI_KEY_FLAG MYSQLI_READ_DEFAULT_FILE MYSQLI_READ_DEFAULT_GROUP MYSQLI_REFRESH_BACKUP_LOG MYSQLI_REFRESH_GRANT MYSQLI_REFRESH_HOSTS MYSQLI_REFRESH_LOG MYSQLI_REFRESH_MASTER MYSQLI_REFRESH_SLAVE MYSQLI_REFRESH_STATUS MYSQLI_REFRESH_TABLES MYSQLI_REFRESH_THREADS MYSQLI_REPORT_ALL MYSQLI_REPORT_ERROR MYSQLI_REPORT_INDEX MYSQLI_REPORT_OFF MYSQLI_REPORT_STRICT MYSQLI_SERVER_PS_OUT_PARAMS MYSQLI_SERVER_PUBLIC_KEY MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED MYSQLI_SERVER_QUERY_NO_INDEX_USED MYSQLI_SERVER_QUERY_WAS_SLOW MYSQLI_SET_CHARSET_DIR MYSQLI_SET_CHARSET_NAME MYSQLI_SET_FLAG MYSQLI_STMT_ATTR_CURSOR_TYPE MYSQLI_STMT_ATTR_PREFETCH_ROWS MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH MYSQLI_STORE_RESULT MYSQLI_STORE_RESULT_COPY_DATA MYSQLI_TIMESTAMP_FLAG MYSQLI_TRANS_COR_AND_CHAIN MYSQLI_TRANS_COR_AND_NO_CHAIN MYSQLI_TRANS_COR_NO_RELEASE MYSQLI_TRANS_COR_RELEASE MYSQLI_TRANS_START_READ_ONLY MYSQLI_TRANS_START_READ_WRITE MYSQLI_TRANS_START_WITH_CONSISTENT_SNAPSHOT MYSQLI_TYPE_BIT MYSQLI_TYPE_BLOB MYSQLI_TYPE_CHAR MYSQLI_TYPE_DATE MYSQLI_TYPE_DATETIME MYSQLI_TYPE_DECIMAL MYSQLI_TYPE_DOUBLE MYSQLI_TYPE_ENUM MYSQLI_TYPE_FLOAT MYSQLI_TYPE_GEOMETRY MYSQLI_TYPE_INT24 MYSQLI_TYPE_INTERVAL MYSQLI_TYPE_JSON MYSQLI_TYPE_LONG MYSQLI_TYPE_LONGLONG MYSQLI_TYPE_LONG_BLOB MYSQLI_TYPE_MEDIUM_BLOB MYSQLI_TYPE_NEWDATE MYSQLI_TYPE_NEWDECIMAL MYSQLI_TYPE_NULL MYSQLI_TYPE_SET MYSQLI_TYPE_SHORT MYSQLI_TYPE_STRING MYSQLI_TYPE_TIME MYSQLI_TYPE_TIMESTAMP MYSQLI_TYPE_TINY MYSQLI_TYPE_TINY_BLOB MYSQLI_TYPE_VAR_STRING MYSQLI_TYPE_YEAR MYSQLI_UNIQUE_KEY_FLAG MYSQLI_UNSIGNED_FLAG MYSQLI_USE_RESULT MYSQLI_ZEROFILL_FLAG contained endif if index(g:php_syntax_extensions_enabled, "openssl") >= 0 && index(g:php_syntax_extensions_disabled, "openssl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "openssl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "openssl") < 0) " openssl constants -syn keyword phpConstants OPENSSL_ALGO_DSS1 OPENSSL_ALGO_MD4 OPENSSL_ALGO_MD5 OPENSSL_ALGO_RMD160 OPENSSL_ALGO_SHA1 OPENSSL_ALGO_SHA224 OPENSSL_ALGO_SHA256 OPENSSL_ALGO_SHA384 OPENSSL_ALGO_SHA512 OPENSSL_CIPHER_3DES OPENSSL_CIPHER_AES_128_CBC OPENSSL_CIPHER_AES_192_CBC OPENSSL_CIPHER_AES_256_CBC OPENSSL_CIPHER_DES OPENSSL_CIPHER_RC2_40 OPENSSL_CIPHER_RC2_64 OPENSSL_CIPHER_RC2_128 OPENSSL_DEFAULT_STREAM_CIPHERS OPENSSL_KEYTYPE_DH OPENSSL_KEYTYPE_DSA OPENSSL_KEYTYPE_EC OPENSSL_KEYTYPE_RSA OPENSSL_NO_PADDING OPENSSL_PKCS1_OAEP_PADDING OPENSSL_PKCS1_PADDING OPENSSL_RAW_DATA OPENSSL_SSLV23_PADDING OPENSSL_TLSEXT_SERVER_NAME OPENSSL_VERSION_NUMBER OPENSSL_VERSION_TEXT OPENSSL_ZERO_PADDING PKCS7_BINARY PKCS7_DETACHED PKCS7_NOATTR PKCS7_NOCERTS PKCS7_NOCHAIN PKCS7_NOINTERN PKCS7_NOSIGS PKCS7_NOVERIFY PKCS7_TEXT X509_PURPOSE_ANY X509_PURPOSE_CRL_SIGN X509_PURPOSE_NS_SSL_SERVER X509_PURPOSE_SMIME_ENCRYPT X509_PURPOSE_SMIME_SIGN X509_PURPOSE_SSL_CLIENT X509_PURPOSE_SSL_SERVER contained +syn keyword phpConstants OPENSSL_ALGO_MD4 OPENSSL_ALGO_MD5 OPENSSL_ALGO_RMD160 OPENSSL_ALGO_SHA1 OPENSSL_ALGO_SHA224 OPENSSL_ALGO_SHA256 OPENSSL_ALGO_SHA384 OPENSSL_ALGO_SHA512 OPENSSL_CIPHER_3DES OPENSSL_CIPHER_AES_128_CBC OPENSSL_CIPHER_AES_192_CBC OPENSSL_CIPHER_AES_256_CBC OPENSSL_CIPHER_DES OPENSSL_CIPHER_RC2_40 OPENSSL_CIPHER_RC2_64 OPENSSL_CIPHER_RC2_128 OPENSSL_DEFAULT_STREAM_CIPHERS OPENSSL_DONT_ZERO_PAD_KEY OPENSSL_KEYTYPE_DH OPENSSL_KEYTYPE_DSA OPENSSL_KEYTYPE_EC OPENSSL_KEYTYPE_RSA OPENSSL_NO_PADDING OPENSSL_PKCS1_OAEP_PADDING OPENSSL_PKCS1_PADDING OPENSSL_RAW_DATA OPENSSL_SSLV23_PADDING OPENSSL_TLSEXT_SERVER_NAME OPENSSL_VERSION_NUMBER OPENSSL_VERSION_TEXT OPENSSL_ZERO_PADDING PKCS7_BINARY PKCS7_DETACHED PKCS7_NOATTR PKCS7_NOCERTS PKCS7_NOCHAIN PKCS7_NOINTERN PKCS7_NOSIGS PKCS7_NOVERIFY PKCS7_TEXT X509_PURPOSE_ANY X509_PURPOSE_CRL_SIGN X509_PURPOSE_NS_SSL_SERVER X509_PURPOSE_SMIME_ENCRYPT X509_PURPOSE_SMIME_SIGN X509_PURPOSE_SSL_CLIENT X509_PURPOSE_SSL_SERVER contained endif if index(g:php_syntax_extensions_enabled, "pcre") >= 0 && index(g:php_syntax_extensions_disabled, "pcre") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "pcre") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "pcre") < 0) " pcre constants -syn keyword phpConstants PCRE_VERSION PREG_BACKTRACK_LIMIT_ERROR PREG_BAD_UTF8_ERROR PREG_BAD_UTF8_OFFSET_ERROR PREG_GREP_INVERT PREG_INTERNAL_ERROR PREG_JIT_STACKLIMIT_ERROR PREG_NO_ERROR PREG_OFFSET_CAPTURE PREG_PATTERN_ORDER PREG_RECURSION_LIMIT_ERROR PREG_SET_ORDER PREG_SPLIT_DELIM_CAPTURE PREG_SPLIT_NO_EMPTY PREG_SPLIT_OFFSET_CAPTURE contained +syn keyword phpConstants PCRE_VERSION PREG_BACKTRACK_LIMIT_ERROR PREG_BAD_UTF8_ERROR PREG_BAD_UTF8_OFFSET_ERROR PREG_GREP_INVERT PREG_INTERNAL_ERROR PREG_JIT_STACKLIMIT_ERROR PREG_NO_ERROR PREG_OFFSET_CAPTURE PREG_PATTERN_ORDER PREG_RECURSION_LIMIT_ERROR PREG_SET_ORDER PREG_SPLIT_DELIM_CAPTURE PREG_SPLIT_NO_EMPTY PREG_SPLIT_OFFSET_CAPTURE PREG_UNMATCHED_AS_NULL contained endif if index(g:php_syntax_extensions_enabled, "pdo") >= 0 && index(g:php_syntax_extensions_disabled, "pdo") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "pdo") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "pdo") < 0) " PDO constants -syn keyword phpConstants ATTR_AUTOCOMMIT ATTR_CASE ATTR_CLIENT_VERSION ATTR_CONNECTION_STATUS ATTR_CURSOR ATTR_CURSOR_NAME ATTR_DEFAULT_FETCH_MODE ATTR_DRIVER_NAME ATTR_EMULATE_PREPARES ATTR_ERRMODE ATTR_FETCH_CATALOG_NAMES ATTR_FETCH_TABLE_NAMES ATTR_MAX_COLUMN_LEN ATTR_ORACLE_NULLS ATTR_PERSISTENT ATTR_PREFETCH ATTR_SERVER_INFO ATTR_SERVER_VERSION ATTR_STATEMENT_CLASS ATTR_STRINGIFY_FETCHES ATTR_TIMEOUT CASE_LOWER CASE_NATURAL CASE_UPPER CURSOR_FWDONLY CURSOR_SCROLL ERRMODE_EXCEPTION ERRMODE_SILENT ERRMODE_WARNING ERR_NONE FETCH_ASSOC FETCH_BOTH FETCH_BOUND FETCH_CLASS FETCH_CLASSTYPE FETCH_COLUMN FETCH_FUNC FETCH_GROUP FETCH_INTO FETCH_KEY_PAIR FETCH_LAZY FETCH_NAMED FETCH_NUM FETCH_OBJ FETCH_ORI_ABS FETCH_ORI_FIRST FETCH_ORI_LAST FETCH_ORI_NEXT FETCH_ORI_PRIOR FETCH_ORI_REL FETCH_PROPS_LATE FETCH_SERIALIZE FETCH_UNIQUE MYSQL_ATTR_COMPRESS MYSQL_ATTR_DIRECT_QUERY MYSQL_ATTR_FOUND_ROWS MYSQL_ATTR_IGNORE_SPACE MYSQL_ATTR_INIT_COMMAND MYSQL_ATTR_LOCAL_INFILE MYSQL_ATTR_MULTI_STATEMENTS MYSQL_ATTR_SERVER_PUBLIC_KEY MYSQL_ATTR_SSL_CA MYSQL_ATTR_SSL_CAPATH MYSQL_ATTR_SSL_CERT MYSQL_ATTR_SSL_CIPHER MYSQL_ATTR_SSL_KEY MYSQL_ATTR_USE_BUFFERED_QUERY NULL_EMPTY_STRING NULL_NATURAL NULL_TO_STRING PARAM_BOOL PARAM_EVT_ALLOC PARAM_EVT_EXEC_POST PARAM_EVT_EXEC_PRE PARAM_EVT_FETCH_POST PARAM_EVT_FETCH_PRE PARAM_EVT_FREE PARAM_EVT_NORMALIZE PARAM_INPUT_OUTPUT PARAM_INT PARAM_LOB PARAM_NULL PARAM_STMT PARAM_STR PGSQL_ATTR_DISABLE_PREPARES PGSQL_TRANSACTION_ACTIVE PGSQL_TRANSACTION_IDLE PGSQL_TRANSACTION_INERROR PGSQL_TRANSACTION_INTRANS PGSQL_TRANSACTION_UNKNOWN contained +syn keyword phpConstants ATTR_AUTOCOMMIT ATTR_CASE ATTR_CLIENT_VERSION ATTR_CONNECTION_STATUS ATTR_CURSOR ATTR_CURSOR_NAME ATTR_DEFAULT_FETCH_MODE ATTR_DEFAULT_STR_PARAM ATTR_DRIVER_NAME ATTR_EMULATE_PREPARES ATTR_ERRMODE ATTR_FETCH_CATALOG_NAMES ATTR_FETCH_TABLE_NAMES ATTR_MAX_COLUMN_LEN ATTR_ORACLE_NULLS ATTR_PERSISTENT ATTR_PREFETCH ATTR_SERVER_INFO ATTR_SERVER_VERSION ATTR_STATEMENT_CLASS ATTR_STRINGIFY_FETCHES ATTR_TIMEOUT CASE_LOWER CASE_NATURAL CASE_UPPER CURSOR_FWDONLY CURSOR_SCROLL ERRMODE_EXCEPTION ERRMODE_SILENT ERRMODE_WARNING ERR_NONE FETCH_ASSOC FETCH_BOTH FETCH_BOUND FETCH_CLASS FETCH_CLASSTYPE FETCH_COLUMN FETCH_FUNC FETCH_GROUP FETCH_INTO FETCH_KEY_PAIR FETCH_LAZY FETCH_NAMED FETCH_NUM FETCH_OBJ FETCH_ORI_ABS FETCH_ORI_FIRST FETCH_ORI_LAST FETCH_ORI_NEXT FETCH_ORI_PRIOR FETCH_ORI_REL FETCH_PROPS_LATE FETCH_SERIALIZE FETCH_UNIQUE MYSQL_ATTR_COMPRESS MYSQL_ATTR_DIRECT_QUERY MYSQL_ATTR_FOUND_ROWS MYSQL_ATTR_IGNORE_SPACE MYSQL_ATTR_INIT_COMMAND MYSQL_ATTR_LOCAL_INFILE MYSQL_ATTR_MULTI_STATEMENTS MYSQL_ATTR_SERVER_PUBLIC_KEY MYSQL_ATTR_SSL_CA MYSQL_ATTR_SSL_CAPATH MYSQL_ATTR_SSL_CERT MYSQL_ATTR_SSL_CIPHER MYSQL_ATTR_SSL_KEY MYSQL_ATTR_SSL_VERIFY_SERVER_CERT MYSQL_ATTR_USE_BUFFERED_QUERY NULL_EMPTY_STRING NULL_NATURAL NULL_TO_STRING PARAM_BOOL PARAM_EVT_ALLOC PARAM_EVT_EXEC_POST PARAM_EVT_EXEC_PRE PARAM_EVT_FETCH_POST PARAM_EVT_FETCH_PRE PARAM_EVT_FREE PARAM_EVT_NORMALIZE PARAM_INPUT_OUTPUT PARAM_INT PARAM_LOB PARAM_NULL PARAM_STMT PARAM_STR PARAM_STR_CHAR PARAM_STR_NATL PGSQL_ATTR_DISABLE_PREPARES PGSQL_TRANSACTION_ACTIVE PGSQL_TRANSACTION_IDLE PGSQL_TRANSACTION_INERROR PGSQL_TRANSACTION_INTRANS PGSQL_TRANSACTION_UNKNOWN contained endif if index(g:php_syntax_extensions_enabled, "pgsql") >= 0 && index(g:php_syntax_extensions_disabled, "pgsql") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "pgsql") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "pgsql") < 0) " pgsql constants @@ -292,7 +292,7 @@ syn keyword phpConstants APACHE_MAP SOAP_1_1 SOAP_1_2 SOAP_ACTOR_NEXT SOAP_ACTOR endif if index(g:php_syntax_extensions_enabled, "sockets") >= 0 && index(g:php_syntax_extensions_disabled, "sockets") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "sockets") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "sockets") < 0) " sockets constants -syn keyword phpConstants AF_INET AF_INET6 AF_UNIX IPPROTO_IP IPPROTO_IPV6 IPV6_HOPLIMIT IPV6_MULTICAST_HOPS IPV6_MULTICAST_IF IPV6_MULTICAST_LOOP IPV6_PKTINFO IPV6_RECVHOPLIMIT IPV6_RECVPKTINFO IPV6_RECVTCLASS IPV6_TCLASS IPV6_UNICAST_HOPS IPV6_V6ONLY IP_MULTICAST_IF IP_MULTICAST_LOOP IP_MULTICAST_TTL MCAST_BLOCK_SOURCE MCAST_JOIN_GROUP MCAST_JOIN_SOURCE_GROUP MCAST_LEAVE_GROUP MCAST_LEAVE_SOURCE_GROUP MCAST_UNBLOCK_SOURCE MSG_CMSG_CLOEXEC MSG_CONFIRM MSG_CTRUNC MSG_DONTROUTE MSG_DONTWAIT MSG_EOF MSG_EOR MSG_ERRQUEUE MSG_MORE MSG_NOSIGNAL MSG_OOB MSG_PEEK MSG_TRUNC MSG_WAITALL MSG_WAITFORONE PHP_BINARY_READ PHP_NORMAL_READ SCM_CREDENTIALS SCM_RIGHTS SOCKET_E2BIG SOCKET_EACCES SOCKET_EADDRINUSE SOCKET_EADDRNOTAVAIL SOCKET_EADV SOCKET_EAFNOSUPPORT SOCKET_EAGAIN SOCKET_EALREADY SOCKET_EBADE SOCKET_EBADF SOCKET_EBADFD SOCKET_EBADMSG SOCKET_EBADR SOCKET_EBADRQC SOCKET_EBADSLT SOCKET_EBUSY SOCKET_ECHRNG SOCKET_ECOMM SOCKET_ECONNABORTED SOCKET_ECONNREFUSED SOCKET_ECONNRESET SOCKET_EDESTADDRREQ SOCKET_EDQUOT SOCKET_EEXIST SOCKET_EFAULT SOCKET_EHOSTDOWN SOCKET_EHOSTUNREACH SOCKET_EIDRM SOCKET_EINPROGRESS SOCKET_EINTR SOCKET_EINVAL SOCKET_EIO SOCKET_EISCONN SOCKET_EISDIR SOCKET_EISNAM SOCKET_EL2HLT SOCKET_EL2NSYNC SOCKET_EL3HLT SOCKET_EL3RST SOCKET_ELNRNG SOCKET_ELOOP SOCKET_EMEDIUMTYPE SOCKET_EMFILE SOCKET_EMLINK SOCKET_EMSGSIZE SOCKET_EMULTIHOP SOCKET_ENAMETOOLONG SOCKET_ENETDOWN SOCKET_ENETRESET SOCKET_ENETUNREACH SOCKET_ENFILE SOCKET_ENOANO SOCKET_ENOBUFS SOCKET_ENOCSI SOCKET_ENODATA SOCKET_ENODEV SOCKET_ENOENT SOCKET_ENOLCK SOCKET_ENOLINK SOCKET_ENOMEDIUM SOCKET_ENOMEM SOCKET_ENOMSG SOCKET_ENONET SOCKET_ENOPROTOOPT SOCKET_ENOSPC SOCKET_ENOSR SOCKET_ENOSTR SOCKET_ENOSYS SOCKET_ENOTBLK SOCKET_ENOTCONN SOCKET_ENOTDIR SOCKET_ENOTEMPTY SOCKET_ENOTSOCK SOCKET_ENOTTY SOCKET_ENOTUNIQ SOCKET_ENXIO SOCKET_EOPNOTSUPP SOCKET_EPERM SOCKET_EPFNOSUPPORT SOCKET_EPIPE SOCKET_EPROTO SOCKET_EPROTONOSUPPORT SOCKET_EPROTOTYPE SOCKET_EREMCHG SOCKET_EREMOTE SOCKET_EREMOTEIO SOCKET_ERESTART SOCKET_EROFS SOCKET_ESHUTDOWN SOCKET_ESOCKTNOSUPPORT SOCKET_ESPIPE SOCKET_ESRMNT SOCKET_ESTRPIPE SOCKET_ETIME SOCKET_ETIMEDOUT SOCKET_ETOOMANYREFS SOCKET_EUNATCH SOCKET_EUSERS SOCKET_EWOULDBLOCK SOCKET_EXDEV SOCKET_EXFULL SOCK_DGRAM SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM SOL_SOCKET SOL_TCP SOL_UDP SOMAXCONN SO_BINDTODEVICE SO_BROADCAST SO_DEBUG SO_DONTROUTE SO_ERROR SO_KEEPALIVE SO_LINGER SO_OOBINLINE SO_PASSCRED SO_RCVBUF SO_RCVLOWAT SO_RCVTIMEO SO_REUSEADDR SO_REUSEPORT SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO SO_TYPE TCP_NODELAY contained +syn keyword phpConstants AF_INET AF_INET6 AF_UNIX AI_ADDRCONFIG AI_ALL AI_CANONIDN AI_CANONNAME AI_IDN AI_IDN_ALLOW_UNASSIGNED AI_IDN_USE_STD3_ASCII_RULES AI_NUMERICHOST AI_NUMERICSERV AI_PASSIVE AI_V4MAPPED IPPROTO_IP IPPROTO_IPV6 IPV6_HOPLIMIT IPV6_MULTICAST_HOPS IPV6_MULTICAST_IF IPV6_MULTICAST_LOOP IPV6_PKTINFO IPV6_RECVHOPLIMIT IPV6_RECVPKTINFO IPV6_RECVTCLASS IPV6_TCLASS IPV6_UNICAST_HOPS IPV6_V6ONLY IP_MULTICAST_IF IP_MULTICAST_LOOP IP_MULTICAST_TTL MCAST_BLOCK_SOURCE MCAST_JOIN_GROUP MCAST_JOIN_SOURCE_GROUP MCAST_LEAVE_GROUP MCAST_LEAVE_SOURCE_GROUP MCAST_UNBLOCK_SOURCE MSG_CMSG_CLOEXEC MSG_CONFIRM MSG_CTRUNC MSG_DONTROUTE MSG_DONTWAIT MSG_EOF MSG_EOR MSG_ERRQUEUE MSG_MORE MSG_NOSIGNAL MSG_OOB MSG_PEEK MSG_TRUNC MSG_WAITALL MSG_WAITFORONE PHP_BINARY_READ PHP_NORMAL_READ SCM_CREDENTIALS SCM_RIGHTS SOCKET_E2BIG SOCKET_EACCES SOCKET_EADDRINUSE SOCKET_EADDRNOTAVAIL SOCKET_EADV SOCKET_EAFNOSUPPORT SOCKET_EAGAIN SOCKET_EALREADY SOCKET_EBADE SOCKET_EBADF SOCKET_EBADFD SOCKET_EBADMSG SOCKET_EBADR SOCKET_EBADRQC SOCKET_EBADSLT SOCKET_EBUSY SOCKET_ECHRNG SOCKET_ECOMM SOCKET_ECONNABORTED SOCKET_ECONNREFUSED SOCKET_ECONNRESET SOCKET_EDESTADDRREQ SOCKET_EDQUOT SOCKET_EEXIST SOCKET_EFAULT SOCKET_EHOSTDOWN SOCKET_EHOSTUNREACH SOCKET_EIDRM SOCKET_EINPROGRESS SOCKET_EINTR SOCKET_EINVAL SOCKET_EIO SOCKET_EISCONN SOCKET_EISDIR SOCKET_EISNAM SOCKET_EL2HLT SOCKET_EL2NSYNC SOCKET_EL3HLT SOCKET_EL3RST SOCKET_ELNRNG SOCKET_ELOOP SOCKET_EMEDIUMTYPE SOCKET_EMFILE SOCKET_EMLINK SOCKET_EMSGSIZE SOCKET_EMULTIHOP SOCKET_ENAMETOOLONG SOCKET_ENETDOWN SOCKET_ENETRESET SOCKET_ENETUNREACH SOCKET_ENFILE SOCKET_ENOANO SOCKET_ENOBUFS SOCKET_ENOCSI SOCKET_ENODATA SOCKET_ENODEV SOCKET_ENOENT SOCKET_ENOLCK SOCKET_ENOLINK SOCKET_ENOMEDIUM SOCKET_ENOMEM SOCKET_ENOMSG SOCKET_ENONET SOCKET_ENOPROTOOPT SOCKET_ENOSPC SOCKET_ENOSR SOCKET_ENOSTR SOCKET_ENOSYS SOCKET_ENOTBLK SOCKET_ENOTCONN SOCKET_ENOTDIR SOCKET_ENOTEMPTY SOCKET_ENOTSOCK SOCKET_ENOTTY SOCKET_ENOTUNIQ SOCKET_ENXIO SOCKET_EOPNOTSUPP SOCKET_EPERM SOCKET_EPFNOSUPPORT SOCKET_EPIPE SOCKET_EPROTO SOCKET_EPROTONOSUPPORT SOCKET_EPROTOTYPE SOCKET_EREMCHG SOCKET_EREMOTE SOCKET_EREMOTEIO SOCKET_ERESTART SOCKET_EROFS SOCKET_ESHUTDOWN SOCKET_ESOCKTNOSUPPORT SOCKET_ESPIPE SOCKET_ESRMNT SOCKET_ESTRPIPE SOCKET_ETIME SOCKET_ETIMEDOUT SOCKET_ETOOMANYREFS SOCKET_EUNATCH SOCKET_EUSERS SOCKET_EWOULDBLOCK SOCKET_EXDEV SOCKET_EXFULL SOCK_DGRAM SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM SOL_SOCKET SOL_TCP SOL_UDP SOMAXCONN SO_BINDTODEVICE SO_BROADCAST SO_DEBUG SO_DONTROUTE SO_ERROR SO_KEEPALIVE SO_LINGER SO_OOBINLINE SO_PASSCRED SO_RCVBUF SO_RCVLOWAT SO_RCVTIMEO SO_REUSEADDR SO_REUSEPORT SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO SO_TYPE TCP_NODELAY contained endif if index(g:php_syntax_extensions_enabled, "spl") >= 0 && index(g:php_syntax_extensions_disabled, "spl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "spl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "spl") < 0) " SPL constants @@ -304,7 +304,7 @@ syn keyword phpConstants SQLITE3_ASSOC SQLITE3_BLOB SQLITE3_BOTH SQLITE3_FLOAT S endif if index(g:php_syntax_extensions_enabled, "standard") >= 0 && index(g:php_syntax_extensions_disabled, "standard") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "standard") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "standard") < 0) " standard constants -syn keyword phpConstants ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7 ABMON_1 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ABMON_10 ABMON_11 ABMON_12 ALT_DIGITS AM_STR ARRAY_FILTER_USE_BOTH ARRAY_FILTER_USE_KEY ASSERT_ACTIVE ASSERT_BAIL ASSERT_CALLBACK ASSERT_EXCEPTION ASSERT_QUIET_EVAL ASSERT_WARNING CASE_LOWER CASE_UPPER CHAR_MAX CODESET CONNECTION_ABORTED CONNECTION_NORMAL CONNECTION_TIMEOUT COUNT_NORMAL COUNT_RECURSIVE CREDITS_ALL CREDITS_DOCS CREDITS_FULLPAGE CREDITS_GENERAL CREDITS_GROUP CREDITS_MODULES CREDITS_QA CREDITS_SAPI CRNCYSTR CRYPT_BLOWFISH CRYPT_EXT_DES CRYPT_MD5 CRYPT_SALT_LENGTH CRYPT_SHA256 CRYPT_SHA512 CRYPT_STD_DES DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7 DIRECTORY_SEPARATOR DNS_A DNS_A6 DNS_AAAA DNS_ALL DNS_ANY DNS_CNAME DNS_HINFO DNS_MX DNS_NAPTR DNS_NS DNS_PTR DNS_SOA DNS_SRV DNS_TXT D_FMT D_T_FMT ENT_COMPAT ENT_DISALLOWED ENT_HTML5 ENT_HTML401 ENT_IGNORE ENT_NOQUOTES ENT_QUOTES ENT_SUBSTITUTE ENT_XHTML ENT_XML1 ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT EXTR_IF_EXISTS EXTR_OVERWRITE EXTR_PREFIX_ALL EXTR_PREFIX_IF_EXISTS EXTR_PREFIX_INVALID EXTR_PREFIX_SAME EXTR_REFS EXTR_SKIP FILE_APPEND FILE_BINARY FILE_IGNORE_NEW_LINES FILE_NO_DEFAULT_CONTEXT FILE_SKIP_EMPTY_LINES FILE_TEXT FILE_USE_INCLUDE_PATH FNM_CASEFOLD FNM_NOESCAPE FNM_PATHNAME FNM_PERIOD GLOB_AVAILABLE_FLAGS GLOB_BRACE GLOB_ERR GLOB_MARK GLOB_NOCHECK GLOB_NOESCAPE GLOB_NOSORT GLOB_ONLYDIR HTML_ENTITIES HTML_SPECIALCHARS IMAGETYPE_BMP IMAGETYPE_COUNT IMAGETYPE_GIF IMAGETYPE_ICO IMAGETYPE_IFF IMAGETYPE_JB2 IMAGETYPE_JP2 IMAGETYPE_JPC IMAGETYPE_JPEG IMAGETYPE_JPEG2000 IMAGETYPE_JPX IMAGETYPE_PNG IMAGETYPE_PSD IMAGETYPE_SWC IMAGETYPE_SWF IMAGETYPE_TIFF_II IMAGETYPE_TIFF_MM IMAGETYPE_UNKNOWN IMAGETYPE_WBMP IMAGETYPE_WEBP IMAGETYPE_XBM INF INFO_ALL INFO_CONFIGURATION INFO_CREDITS INFO_ENVIRONMENT INFO_GENERAL INFO_LICENSE INFO_MODULES INFO_VARIABLES INI_ALL INI_PERDIR INI_SCANNER_NORMAL INI_SCANNER_RAW INI_SCANNER_TYPED INI_SYSTEM INI_USER LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCK_EX LOCK_NB LOCK_SH LOCK_UN LOG_ALERT LOG_AUTH LOG_AUTHPRIV LOG_CONS LOG_CRIT LOG_CRON LOG_DAEMON LOG_DEBUG LOG_EMERG LOG_ERR LOG_INFO LOG_KERN LOG_LOCAL0 LOG_LOCAL1 LOG_LOCAL2 LOG_LOCAL3 LOG_LOCAL4 LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 LOG_LPR LOG_MAIL LOG_NDELAY LOG_NEWS LOG_NOTICE LOG_NOWAIT LOG_ODELAY LOG_PERROR LOG_PID LOG_SYSLOG LOG_USER LOG_UUCP LOG_WARNING MON_1 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 MON_10 MON_11 MON_12 MT_RAND_MT19937 MT_RAND_PHP M_1_PI M_2_PI M_2_SQRTPI M_E M_EULER M_LN2 M_LN10 M_LNPI M_LOG2E M_LOG10E M_PI M_PI_2 M_PI_4 M_SQRT1_2 M_SQRT2 M_SQRT3 M_SQRTPI NAN NOEXPR PASSWORD_BCRYPT PASSWORD_BCRYPT_DEFAULT_COST PASSWORD_DEFAULT PATHINFO_BASENAME PATHINFO_DIRNAME PATHINFO_EXTENSION PATHINFO_FILENAME PATH_SEPARATOR PHP_QUERY_RFC1738 PHP_QUERY_RFC3986 PHP_ROUND_HALF_DOWN PHP_ROUND_HALF_EVEN PHP_ROUND_HALF_ODD PHP_ROUND_HALF_UP PHP_URL_FRAGMENT PHP_URL_HOST PHP_URL_PASS PHP_URL_PATH PHP_URL_PORT PHP_URL_QUERY PHP_URL_SCHEME PHP_URL_USER PM_STR PSFS_ERR_FATAL PSFS_FEED_ME PSFS_FLAG_FLUSH_CLOSE PSFS_FLAG_FLUSH_INC PSFS_FLAG_NORMAL PSFS_PASS_ON RADIXCHAR SCANDIR_SORT_ASCENDING SCANDIR_SORT_DESCENDING SCANDIR_SORT_NONE SEEK_CUR SEEK_END SEEK_SET SORT_ASC SORT_DESC SORT_FLAG_CASE SORT_LOCALE_STRING SORT_NATURAL SORT_NUMERIC SORT_REGULAR SORT_STRING STREAM_BUFFER_FULL STREAM_BUFFER_LINE STREAM_BUFFER_NONE STREAM_CAST_AS_STREAM STREAM_CAST_FOR_SELECT STREAM_CLIENT_ASYNC_CONNECT STREAM_CLIENT_CONNECT STREAM_CLIENT_PERSISTENT STREAM_CRYPTO_METHOD_ANY_CLIENT STREAM_CRYPTO_METHOD_ANY_SERVER STREAM_CRYPTO_METHOD_SSLv2_CLIENT STREAM_CRYPTO_METHOD_SSLv2_SERVER STREAM_CRYPTO_METHOD_SSLv3_CLIENT STREAM_CRYPTO_METHOD_SSLv3_SERVER STREAM_CRYPTO_METHOD_SSLv23_CLIENT STREAM_CRYPTO_METHOD_SSLv23_SERVER STREAM_CRYPTO_METHOD_TLS_CLIENT STREAM_CRYPTO_METHOD_TLS_SERVER STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT STREAM_CRYPTO_METHOD_TLSv1_0_SERVER STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT STREAM_CRYPTO_METHOD_TLSv1_1_SERVER STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT STREAM_CRYPTO_METHOD_TLSv1_2_SERVER STREAM_FILTER_ALL STREAM_FILTER_READ STREAM_FILTER_WRITE STREAM_IGNORE_URL STREAM_IPPROTO_ICMP STREAM_IPPROTO_IP STREAM_IPPROTO_RAW STREAM_IPPROTO_TCP STREAM_IPPROTO_UDP STREAM_IS_URL STREAM_META_ACCESS STREAM_META_GROUP STREAM_META_GROUP_NAME STREAM_META_OWNER STREAM_META_OWNER_NAME STREAM_META_TOUCH STREAM_MKDIR_RECURSIVE STREAM_MUST_SEEK STREAM_NOTIFY_AUTH_REQUIRED STREAM_NOTIFY_AUTH_RESULT STREAM_NOTIFY_COMPLETED STREAM_NOTIFY_CONNECT STREAM_NOTIFY_FAILURE STREAM_NOTIFY_FILE_SIZE_IS STREAM_NOTIFY_MIME_TYPE_IS STREAM_NOTIFY_PROGRESS STREAM_NOTIFY_REDIRECTED STREAM_NOTIFY_RESOLVE STREAM_NOTIFY_SEVERITY_ERR STREAM_NOTIFY_SEVERITY_INFO STREAM_NOTIFY_SEVERITY_WARN STREAM_OOB STREAM_OPTION_BLOCKING STREAM_OPTION_READ_BUFFER STREAM_OPTION_READ_TIMEOUT STREAM_OPTION_WRITE_BUFFER STREAM_PEEK STREAM_PF_INET STREAM_PF_INET6 STREAM_PF_UNIX STREAM_REPORT_ERRORS STREAM_SERVER_BIND STREAM_SERVER_LISTEN STREAM_SHUT_RD STREAM_SHUT_RDWR STREAM_SHUT_WR STREAM_SOCK_DGRAM STREAM_SOCK_RAW STREAM_SOCK_RDM STREAM_SOCK_SEQPACKET STREAM_SOCK_STREAM STREAM_URL_STAT_LINK STREAM_URL_STAT_QUIET STREAM_USE_PATH STR_PAD_BOTH STR_PAD_LEFT STR_PAD_RIGHT THOUSEP T_FMT T_FMT_AMPM YESEXPR contained +syn keyword phpConstants ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7 ABMON_1 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ABMON_10 ABMON_11 ABMON_12 ALT_DIGITS AM_STR ARRAY_FILTER_USE_BOTH ARRAY_FILTER_USE_KEY ASSERT_ACTIVE ASSERT_BAIL ASSERT_CALLBACK ASSERT_EXCEPTION ASSERT_QUIET_EVAL ASSERT_WARNING CASE_LOWER CASE_UPPER CHAR_MAX CODESET CONNECTION_ABORTED CONNECTION_NORMAL CONNECTION_TIMEOUT COUNT_NORMAL COUNT_RECURSIVE CREDITS_ALL CREDITS_DOCS CREDITS_FULLPAGE CREDITS_GENERAL CREDITS_GROUP CREDITS_MODULES CREDITS_QA CREDITS_SAPI CRNCYSTR CRYPT_BLOWFISH CRYPT_EXT_DES CRYPT_MD5 CRYPT_SALT_LENGTH CRYPT_SHA256 CRYPT_SHA512 CRYPT_STD_DES DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7 DIRECTORY_SEPARATOR DNS_A DNS_A6 DNS_AAAA DNS_ALL DNS_ANY DNS_CAA DNS_CNAME DNS_HINFO DNS_MX DNS_NAPTR DNS_NS DNS_PTR DNS_SOA DNS_SRV DNS_TXT D_FMT D_T_FMT ENT_COMPAT ENT_DISALLOWED ENT_HTML5 ENT_HTML401 ENT_IGNORE ENT_NOQUOTES ENT_QUOTES ENT_SUBSTITUTE ENT_XHTML ENT_XML1 ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT EXTR_IF_EXISTS EXTR_OVERWRITE EXTR_PREFIX_ALL EXTR_PREFIX_IF_EXISTS EXTR_PREFIX_INVALID EXTR_PREFIX_SAME EXTR_REFS EXTR_SKIP FILE_APPEND FILE_BINARY FILE_IGNORE_NEW_LINES FILE_NO_DEFAULT_CONTEXT FILE_SKIP_EMPTY_LINES FILE_TEXT FILE_USE_INCLUDE_PATH FNM_CASEFOLD FNM_NOESCAPE FNM_PATHNAME FNM_PERIOD GLOB_AVAILABLE_FLAGS GLOB_BRACE GLOB_ERR GLOB_MARK GLOB_NOCHECK GLOB_NOESCAPE GLOB_NOSORT GLOB_ONLYDIR HTML_ENTITIES HTML_SPECIALCHARS IMAGETYPE_BMP IMAGETYPE_COUNT IMAGETYPE_GIF IMAGETYPE_ICO IMAGETYPE_IFF IMAGETYPE_JB2 IMAGETYPE_JP2 IMAGETYPE_JPC IMAGETYPE_JPEG IMAGETYPE_JPEG2000 IMAGETYPE_JPX IMAGETYPE_PNG IMAGETYPE_PSD IMAGETYPE_SWC IMAGETYPE_SWF IMAGETYPE_TIFF_II IMAGETYPE_TIFF_MM IMAGETYPE_UNKNOWN IMAGETYPE_WBMP IMAGETYPE_WEBP IMAGETYPE_XBM INF INFO_ALL INFO_CONFIGURATION INFO_CREDITS INFO_ENVIRONMENT INFO_GENERAL INFO_LICENSE INFO_MODULES INFO_VARIABLES INI_ALL INI_PERDIR INI_SCANNER_NORMAL INI_SCANNER_RAW INI_SCANNER_TYPED INI_SYSTEM INI_USER LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCK_EX LOCK_NB LOCK_SH LOCK_UN LOG_ALERT LOG_AUTH LOG_AUTHPRIV LOG_CONS LOG_CRIT LOG_CRON LOG_DAEMON LOG_DEBUG LOG_EMERG LOG_ERR LOG_INFO LOG_KERN LOG_LOCAL0 LOG_LOCAL1 LOG_LOCAL2 LOG_LOCAL3 LOG_LOCAL4 LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 LOG_LPR LOG_MAIL LOG_NDELAY LOG_NEWS LOG_NOTICE LOG_NOWAIT LOG_ODELAY LOG_PERROR LOG_PID LOG_SYSLOG LOG_USER LOG_UUCP LOG_WARNING MON_1 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 MON_10 MON_11 MON_12 MT_RAND_MT19937 MT_RAND_PHP M_1_PI M_2_PI M_2_SQRTPI M_E M_EULER M_LN2 M_LN10 M_LNPI M_LOG2E M_LOG10E M_PI M_PI_2 M_PI_4 M_SQRT1_2 M_SQRT2 M_SQRT3 M_SQRTPI NAN NOEXPR PASSWORD_ARGON2I PASSWORD_ARGON2_DEFAULT_MEMORY_COST PASSWORD_ARGON2_DEFAULT_THREADS PASSWORD_ARGON2_DEFAULT_TIME_COST PASSWORD_BCRYPT PASSWORD_BCRYPT_DEFAULT_COST PASSWORD_DEFAULT PATHINFO_BASENAME PATHINFO_DIRNAME PATHINFO_EXTENSION PATHINFO_FILENAME PATH_SEPARATOR PHP_QUERY_RFC1738 PHP_QUERY_RFC3986 PHP_ROUND_HALF_DOWN PHP_ROUND_HALF_EVEN PHP_ROUND_HALF_ODD PHP_ROUND_HALF_UP PHP_URL_FRAGMENT PHP_URL_HOST PHP_URL_PASS PHP_URL_PATH PHP_URL_PORT PHP_URL_QUERY PHP_URL_SCHEME PHP_URL_USER PM_STR PSFS_ERR_FATAL PSFS_FEED_ME PSFS_FLAG_FLUSH_CLOSE PSFS_FLAG_FLUSH_INC PSFS_FLAG_NORMAL PSFS_PASS_ON RADIXCHAR SCANDIR_SORT_ASCENDING SCANDIR_SORT_DESCENDING SCANDIR_SORT_NONE SEEK_CUR SEEK_END SEEK_SET SORT_ASC SORT_DESC SORT_FLAG_CASE SORT_LOCALE_STRING SORT_NATURAL SORT_NUMERIC SORT_REGULAR SORT_STRING STREAM_BUFFER_FULL STREAM_BUFFER_LINE STREAM_BUFFER_NONE STREAM_CAST_AS_STREAM STREAM_CAST_FOR_SELECT STREAM_CLIENT_ASYNC_CONNECT STREAM_CLIENT_CONNECT STREAM_CLIENT_PERSISTENT STREAM_CRYPTO_METHOD_ANY_CLIENT STREAM_CRYPTO_METHOD_ANY_SERVER STREAM_CRYPTO_METHOD_SSLv2_CLIENT STREAM_CRYPTO_METHOD_SSLv2_SERVER STREAM_CRYPTO_METHOD_SSLv3_CLIENT STREAM_CRYPTO_METHOD_SSLv3_SERVER STREAM_CRYPTO_METHOD_SSLv23_CLIENT STREAM_CRYPTO_METHOD_SSLv23_SERVER STREAM_CRYPTO_METHOD_TLS_CLIENT STREAM_CRYPTO_METHOD_TLS_SERVER STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT STREAM_CRYPTO_METHOD_TLSv1_0_SERVER STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT STREAM_CRYPTO_METHOD_TLSv1_1_SERVER STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT STREAM_CRYPTO_METHOD_TLSv1_2_SERVER STREAM_FILTER_ALL STREAM_FILTER_READ STREAM_FILTER_WRITE STREAM_IGNORE_URL STREAM_IPPROTO_ICMP STREAM_IPPROTO_IP STREAM_IPPROTO_RAW STREAM_IPPROTO_TCP STREAM_IPPROTO_UDP STREAM_IS_URL STREAM_META_ACCESS STREAM_META_GROUP STREAM_META_GROUP_NAME STREAM_META_OWNER STREAM_META_OWNER_NAME STREAM_META_TOUCH STREAM_MKDIR_RECURSIVE STREAM_MUST_SEEK STREAM_NOTIFY_AUTH_REQUIRED STREAM_NOTIFY_AUTH_RESULT STREAM_NOTIFY_COMPLETED STREAM_NOTIFY_CONNECT STREAM_NOTIFY_FAILURE STREAM_NOTIFY_FILE_SIZE_IS STREAM_NOTIFY_MIME_TYPE_IS STREAM_NOTIFY_PROGRESS STREAM_NOTIFY_REDIRECTED STREAM_NOTIFY_RESOLVE STREAM_NOTIFY_SEVERITY_ERR STREAM_NOTIFY_SEVERITY_INFO STREAM_NOTIFY_SEVERITY_WARN STREAM_OOB STREAM_OPTION_BLOCKING STREAM_OPTION_READ_BUFFER STREAM_OPTION_READ_TIMEOUT STREAM_OPTION_WRITE_BUFFER STREAM_PEEK STREAM_PF_INET STREAM_PF_INET6 STREAM_PF_UNIX STREAM_REPORT_ERRORS STREAM_SERVER_BIND STREAM_SERVER_LISTEN STREAM_SHUT_RD STREAM_SHUT_RDWR STREAM_SHUT_WR STREAM_SOCK_DGRAM STREAM_SOCK_RAW STREAM_SOCK_RDM STREAM_SOCK_SEQPACKET STREAM_SOCK_STREAM STREAM_URL_STAT_LINK STREAM_URL_STAT_QUIET STREAM_USE_PATH STR_PAD_BOTH STR_PAD_LEFT STR_PAD_RIGHT THOUSEP T_FMT T_FMT_AMPM YESEXPR contained endif if index(g:php_syntax_extensions_enabled, "tokenizer") >= 0 && index(g:php_syntax_extensions_disabled, "tokenizer") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "tokenizer") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "tokenizer") < 0) " tokenizer constants @@ -320,11 +320,11 @@ syn keyword phpConstants ATTRIBUTE CDATA COMMENT DEFAULTATTRS DOC DOC_FRAGMENT D endif if index(g:php_syntax_extensions_enabled, "zip") >= 0 && index(g:php_syntax_extensions_disabled, "zip") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "zip") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "zip") < 0) " zip constants -syn keyword phpConstants CHECKCONS CM_BZIP2 CM_DEFAULT CM_DEFLATE CM_DEFLATE64 CM_IMPLODE CM_LZ77 CM_LZMA CM_PKWARE_IMPLODE CM_PPMD CM_REDUCE_1 CM_REDUCE_2 CM_REDUCE_3 CM_REDUCE_4 CM_SHRINK CM_STORE CM_TERSE CM_WAVPACK CREATE ER_CHANGED ER_CLOSE ER_COMPNOTSUPP ER_CRC ER_DELETED ER_EOF ER_EXISTS ER_INCONS ER_INTERNAL ER_INVAL ER_MEMORY ER_MULTIDISK ER_NOENT ER_NOZIP ER_OK ER_OPEN ER_READ ER_REMOVE ER_RENAME ER_SEEK ER_TMPOPEN ER_WRITE ER_ZIPCLOSED ER_ZLIB EXCL FL_COMPRESSED FL_ENC_CP437 FL_ENC_GUESS FL_ENC_RAW FL_ENC_STRICT FL_ENC_UTF_8 FL_NOCASE FL_NODIR FL_UNCHANGED OPSYS_ACORN_RISC OPSYS_ALTERNATE_MVS OPSYS_AMIGA OPSYS_ATARI_ST OPSYS_BEOS OPSYS_DEFAULT OPSYS_DOS OPSYS_MACINTOSH OPSYS_MVS OPSYS_OPENVMS OPSYS_OS_2 OPSYS_OS_400 OPSYS_OS_X OPSYS_TANDEM OPSYS_UNIX OPSYS_VFAT OPSYS_VM_CMS OPSYS_VSE OPSYS_WINDOWS_NTFS OPSYS_Z_CPM OPSYS_Z_SYSTEM OVERWRITE contained +syn keyword phpConstants CHECKCONS CM_BZIP2 CM_DEFAULT CM_DEFLATE CM_DEFLATE64 CM_IMPLODE CM_LZ77 CM_LZMA CM_PKWARE_IMPLODE CM_PPMD CM_REDUCE_1 CM_REDUCE_2 CM_REDUCE_3 CM_REDUCE_4 CM_SHRINK CM_STORE CM_TERSE CM_WAVPACK CREATE EM_AES_128 EM_AES_192 EM_AES_256 EM_NONE ER_CHANGED ER_CLOSE ER_COMPNOTSUPP ER_CRC ER_DELETED ER_EOF ER_EXISTS ER_INCONS ER_INTERNAL ER_INVAL ER_MEMORY ER_MULTIDISK ER_NOENT ER_NOZIP ER_OK ER_OPEN ER_READ ER_REMOVE ER_RENAME ER_SEEK ER_TMPOPEN ER_WRITE ER_ZIPCLOSED ER_ZLIB EXCL FL_COMPRESSED FL_ENC_CP437 FL_ENC_GUESS FL_ENC_RAW FL_ENC_STRICT FL_ENC_UTF_8 FL_NOCASE FL_NODIR FL_UNCHANGED OPSYS_ACORN_RISC OPSYS_ALTERNATE_MVS OPSYS_AMIGA OPSYS_ATARI_ST OPSYS_BEOS OPSYS_DEFAULT OPSYS_DOS OPSYS_MACINTOSH OPSYS_MVS OPSYS_OPENVMS OPSYS_OS_2 OPSYS_OS_400 OPSYS_OS_X OPSYS_TANDEM OPSYS_UNIX OPSYS_VFAT OPSYS_VM_CMS OPSYS_VSE OPSYS_WINDOWS_NTFS OPSYS_Z_CPM OPSYS_Z_SYSTEM OVERWRITE contained endif if index(g:php_syntax_extensions_enabled, "zlib") >= 0 && index(g:php_syntax_extensions_disabled, "zlib") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "zlib") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "zlib") < 0) " zlib constants -syn keyword phpConstants FORCE_DEFLATE FORCE_GZIP ZLIB_BLOCK ZLIB_DEFAULT_STRATEGY ZLIB_ENCODING_DEFLATE ZLIB_ENCODING_GZIP ZLIB_ENCODING_RAW ZLIB_FILTERED ZLIB_FINISH ZLIB_FIXED ZLIB_FULL_FLUSH ZLIB_HUFFMAN_ONLY ZLIB_NO_FLUSH ZLIB_PARTIAL_FLUSH ZLIB_RLE ZLIB_SYNC_FLUSH ZLIB_VERNUM ZLIB_VERSION contained +syn keyword phpConstants FORCE_DEFLATE FORCE_GZIP ZLIB_BLOCK ZLIB_BUF_ERROR ZLIB_DATA_ERROR ZLIB_DEFAULT_STRATEGY ZLIB_ENCODING_DEFLATE ZLIB_ENCODING_GZIP ZLIB_ENCODING_RAW ZLIB_ERRNO ZLIB_FILTERED ZLIB_FINISH ZLIB_FIXED ZLIB_FULL_FLUSH ZLIB_HUFFMAN_ONLY ZLIB_MEM_ERROR ZLIB_NEED_DICT ZLIB_NO_FLUSH ZLIB_OK ZLIB_PARTIAL_FLUSH ZLIB_RLE ZLIB_STREAM_END ZLIB_STREAM_ERROR ZLIB_SYNC_FLUSH ZLIB_VERNUM ZLIB_VERSION ZLIB_VERSION_ERROR contained endif syn case ignore if index(g:php_syntax_extensions_enabled, "bcmath") >= 0 && index(g:php_syntax_extensions_disabled, "bcmath") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "bcmath") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "bcmath") < 0) @@ -339,7 +339,7 @@ if index(g:php_syntax_extensions_enabled, "core") >= 0 && index(g:php_syntax_ext " Core functions syn keyword phpFunctions class_alias class_exists create_function debug_backtrace debug_print_backtrace define defined each error_reporting extension_loaded func_get_arg func_get_args func_num_args function_exists gc_collect_cycles gc_disable gc_enable gc_enabled gc_mem_caches get_called_class get_class get_class_methods get_class_vars get_declared_classes get_declared_interfaces get_declared_traits get_defined_constants get_defined_functions get_defined_vars get_extension_funcs get_included_files get_loaded_extensions get_object_vars get_parent_class get_required_files get_resource_type get_resources interface_exists is_a is_subclass_of method_exists property_exists restore_error_handler restore_exception_handler set_error_handler set_exception_handler strcasecmp strcmp strlen strncasecmp strncmp trait_exists trigger_error user_error zend_version contained " Core classes and interfaces -syn keyword phpClasses ArgumentCountError ArithmeticError ArrayAccess ClosedGeneratorException Closure DivisionByZeroError Error ErrorException Exception Generator Iterator IteratorAggregate ParseError Serializable Throwable Traversable TypeError stdClass contained +syn keyword phpClasses ArgumentCountError ArithmeticError ArrayAccess ClosedGeneratorException Closure Countable DivisionByZeroError Error ErrorException Exception Generator Iterator IteratorAggregate ParseError Serializable Throwable Traversable TypeError stdClass contained endif if index(g:php_syntax_extensions_enabled, "curl") >= 0 && index(g:php_syntax_extensions_disabled, "curl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "curl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "curl") < 0) " curl functions @@ -365,7 +365,7 @@ syn keyword phpFunctions ereg ereg_replace eregi eregi_replace split spliti sql_ endif if index(g:php_syntax_extensions_enabled, "gd") >= 0 && index(g:php_syntax_extensions_disabled, "gd") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "gd") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "gd") < 0) " gd functions -syn keyword phpFunctions gd_info image2wbmp imageaffine imageaffinematrixconcat imageaffinematrixget imagealphablending imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imageconvolution imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromwebp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagecrop imagecropauto imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefilter imageflip imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd imagegd2 imagegif imageinterlace imageistruecolor imagejpeg imagelayereffect imageline imageloadfont imagepalettecopy imagepalettetotruecolor imagepng imagepolygon imagerectangle imagerotate imagesavealpha imagescale imagesetbrush imagesetinterpolation imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp imagewebp imagexbm jpeg2wbmp png2wbmp contained +syn keyword phpFunctions gd_info image2wbmp imageaffine imageaffinematrixconcat imageaffinematrixget imagealphablending imageantialias imagearc imagebmp imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imageconvolution imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefrombmp imagecreatefromgd imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromwebp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagecrop imagecropauto imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefilter imageflip imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd imagegd2 imagegetclip imagegif imageinterlace imageistruecolor imagejpeg imagelayereffect imageline imageloadfont imageopenpolygon imagepalettecopy imagepalettetotruecolor imagepng imagepolygon imagerectangle imageresolution imagerotate imagesavealpha imagescale imagesetbrush imagesetclip imagesetinterpolation imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp imagewebp imagexbm jpeg2wbmp png2wbmp contained endif if index(g:php_syntax_extensions_enabled, "gettext") >= 0 && index(g:php_syntax_extensions_disabled, "gettext") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "gettext") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "gettext") < 0) " gettext functions @@ -373,7 +373,9 @@ syn keyword phpFunctions _ bind_textdomain_codeset bindtextdomain dcgettext dcng endif if index(g:php_syntax_extensions_enabled, "hash") >= 0 && index(g:php_syntax_extensions_disabled, "hash") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "hash") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "hash") < 0) " hash functions -syn keyword phpFunctions hash hash_algos hash_copy hash_equals hash_file hash_final hash_hmac hash_hmac_file hash_init hash_pbkdf2 hash_update hash_update_file hash_update_stream mhash mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k contained +syn keyword phpFunctions hash hash_algos hash_copy hash_equals hash_file hash_final hash_hkdf hash_hmac hash_hmac_algos hash_hmac_file hash_init hash_pbkdf2 hash_update hash_update_file hash_update_stream mhash mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k contained +" hash classes and interfaces +syn keyword phpClasses HashContext contained endif if index(g:php_syntax_extensions_enabled, "iconv") >= 0 && index(g:php_syntax_extensions_disabled, "iconv") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "iconv") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "iconv") < 0) " iconv functions @@ -393,7 +395,7 @@ syn keyword phpClasses LibXMLError contained endif if index(g:php_syntax_extensions_enabled, "mbstring") >= 0 && index(g:php_syntax_extensions_disabled, "mbstring") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "mbstring") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "mbstring") < 0) " mbstring functions -syn keyword phpFunctions mb_check_encoding mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_encoding_aliases mb_ereg mb_ereg_match mb_ereg_replace mb_ereg_replace_callback mb_ereg_search mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_eregi mb_eregi_replace mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_list_encodings mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_stripos mb_stristr mb_strlen mb_strpos mb_strrchr mb_strrichr mb_strripos mb_strrpos mb_strstr mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr mb_substr_count mbereg mbereg_match mbereg_replace mbereg_search mbereg_search_getpos mbereg_search_getregs mbereg_search_init mbereg_search_pos mbereg_search_regs mbereg_search_setpos mberegi mberegi_replace mbregex_encoding mbsplit contained +syn keyword phpFunctions mb_check_encoding mb_chr mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_encoding_aliases mb_ereg mb_ereg_match mb_ereg_replace mb_ereg_replace_callback mb_ereg_search mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_eregi mb_eregi_replace mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_list_encodings mb_ord mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_scrub mb_send_mail mb_split mb_strcut mb_strimwidth mb_stripos mb_stristr mb_strlen mb_strpos mb_strrchr mb_strrichr mb_strripos mb_strrpos mb_strstr mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr mb_substr_count mbereg mbereg_match mbereg_replace mbereg_search mbereg_search_getpos mbereg_search_getregs mbereg_search_init mbereg_search_pos mbereg_search_regs mbereg_search_setpos mberegi mberegi_replace mbregex_encoding mbsplit contained endif if index(g:php_syntax_extensions_enabled, "mcrypt") >= 0 && index(g:php_syntax_extensions_disabled, "mcrypt") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "mcrypt") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "mcrypt") < 0) " mcrypt functions @@ -411,7 +413,7 @@ syn keyword phpClasses mysqli mysqli_driver mysqli_result mysqli_sql_exception m endif if index(g:php_syntax_extensions_enabled, "openssl") >= 0 && index(g:php_syntax_extensions_disabled, "openssl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "openssl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "openssl") < 0) " openssl functions -syn keyword phpFunctions openssl_cipher_iv_length openssl_csr_export openssl_csr_export_to_file openssl_csr_get_public_key openssl_csr_get_subject openssl_csr_new openssl_csr_sign openssl_decrypt openssl_dh_compute_key openssl_digest openssl_encrypt openssl_error_string openssl_free_key openssl_get_cert_locations openssl_get_cipher_methods openssl_get_curve_names openssl_get_md_methods openssl_get_privatekey openssl_get_publickey openssl_open openssl_pbkdf2 openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkcs12_export openssl_pkcs12_export_to_file openssl_pkcs12_read openssl_pkey_export openssl_pkey_export_to_file openssl_pkey_free openssl_pkey_get_details openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_random_pseudo_bytes openssl_seal openssl_sign openssl_spki_export openssl_spki_export_challenge openssl_spki_new openssl_spki_verify openssl_verify openssl_x509_check_private_key openssl_x509_checkpurpose openssl_x509_export openssl_x509_export_to_file openssl_x509_fingerprint openssl_x509_free openssl_x509_parse openssl_x509_read contained +syn keyword phpFunctions openssl_cipher_iv_length openssl_csr_export openssl_csr_export_to_file openssl_csr_get_public_key openssl_csr_get_subject openssl_csr_new openssl_csr_sign openssl_decrypt openssl_dh_compute_key openssl_digest openssl_encrypt openssl_error_string openssl_free_key openssl_get_cert_locations openssl_get_cipher_methods openssl_get_curve_names openssl_get_md_methods openssl_get_privatekey openssl_get_publickey openssl_open openssl_pbkdf2 openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_read openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkcs12_export openssl_pkcs12_export_to_file openssl_pkcs12_read openssl_pkey_export openssl_pkey_export_to_file openssl_pkey_free openssl_pkey_get_details openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_random_pseudo_bytes openssl_seal openssl_sign openssl_spki_export openssl_spki_export_challenge openssl_spki_new openssl_spki_verify openssl_verify openssl_x509_check_private_key openssl_x509_checkpurpose openssl_x509_export openssl_x509_export_to_file openssl_x509_fingerprint openssl_x509_free openssl_x509_parse openssl_x509_read contained endif if index(g:php_syntax_extensions_enabled, "pcre") >= 0 && index(g:php_syntax_extensions_disabled, "pcre") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "pcre") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "pcre") < 0) " pcre functions @@ -455,13 +457,13 @@ syn keyword phpClasses SoapClient SoapFault SoapHeader SoapParam SoapServer Soap endif if index(g:php_syntax_extensions_enabled, "sockets") >= 0 && index(g:php_syntax_extensions_disabled, "sockets") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "sockets") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "sockets") < 0) " sockets functions -syn keyword phpFunctions socket_accept socket_bind socket_clear_error socket_close socket_cmsg_space socket_connect socket_create socket_create_listen socket_create_pair socket_export_stream socket_get_option socket_getopt socket_getpeername socket_getsockname socket_import_stream socket_last_error socket_listen socket_read socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_setopt socket_shutdown socket_strerror socket_write contained +syn keyword phpFunctions socket_accept socket_addrinfo_bind socket_addrinfo_connect socket_addrinfo_explain socket_addrinfo_lookup socket_bind socket_clear_error socket_close socket_cmsg_space socket_connect socket_create socket_create_listen socket_create_pair socket_export_stream socket_get_option socket_getopt socket_getpeername socket_getsockname socket_import_stream socket_last_error socket_listen socket_read socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_setopt socket_shutdown socket_strerror socket_write contained endif if index(g:php_syntax_extensions_enabled, "spl") >= 0 && index(g:php_syntax_extensions_disabled, "spl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "spl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "spl") < 0) " SPL functions -syn keyword phpFunctions class_implements class_parents class_uses iterator_apply iterator_count iterator_to_array spl_autoload spl_autoload_call spl_autoload_extensions spl_autoload_functions spl_autoload_register spl_autoload_unregister spl_classes spl_object_hash contained +syn keyword phpFunctions class_implements class_parents class_uses iterator_apply iterator_count iterator_to_array spl_autoload spl_autoload_call spl_autoload_extensions spl_autoload_functions spl_autoload_register spl_autoload_unregister spl_classes spl_object_hash spl_object_id contained " SPL classes and interfaces -syn keyword phpClasses AppendIterator ArrayIterator ArrayObject BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator Countable DirectoryIterator DomainException EmptyIterator FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplTempFileObject UnderflowException UnexpectedValueException contained +syn keyword phpClasses AppendIterator ArrayIterator ArrayObject BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator DirectoryIterator DomainException EmptyIterator FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplTempFileObject UnderflowException UnexpectedValueException contained endif if index(g:php_syntax_extensions_enabled, "sqlite3") >= 0 && index(g:php_syntax_extensions_disabled, "sqlite3") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "sqlite3") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "sqlite3") < 0) " sqlite3 classes and interfaces @@ -469,7 +471,7 @@ syn keyword phpClasses SQLite3 SQLite3Result SQLite3Stmt contained endif if index(g:php_syntax_extensions_enabled, "standard") >= 0 && index(g:php_syntax_extensions_disabled, "standard") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "standard") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "standard") < 0) " standard functions -syn keyword phpFunctions abs acos acosh addcslashes addslashes array_change_key_case array_chunk array_column array_combine array_count_values array_diff array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill array_fill_keys array_filter array_flip array_intersect array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map array_merge array_merge_recursive array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace array_replace_recursive array_reverse array_search array_shift array_slice array_splice array_sum array_udiff array_udiff_assoc array_udiff_uassoc array_uintersect array_uintersect_assoc array_uintersect_uassoc array_unique array_unshift array_values array_walk array_walk_recursive arsort asin asinh asort assert assert_options atan atan2 atanh base64_decode base64_encode base_convert basename bin2hex bindec boolval call_user_func call_user_func_array ceil chdir checkdnsrr chgrp chmod chop chown chr chroot chunk_split clearstatcache cli_get_process_title cli_set_process_title closedir closelog compact connection_aborted connection_status constant convert_cyr_string convert_uudecode convert_uuencode copy cos cosh count count_chars crc32 crypt current debug_zval_dump decbin dechex decoct deg2rad dir dirname disk_free_space disk_total_space diskfreespace dl dns_check_record dns_get_mx dns_get_record doubleval end error_clear_last error_get_last error_log escapeshellarg escapeshellcmd exec exp explode expm1 extract ezmlm_hash fclose feof fflush fgetc fgetcsv fgets fgetss file file_exists file_get_contents file_put_contents fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype floatval flock floor flush fmod fnmatch fopen forward_static_call forward_static_call_array fpassthru fprintf fputcsv fputs fread fscanf fseek fsockopen fstat ftell ftok ftruncate fwrite get_browser get_cfg_var get_current_user get_headers get_html_translation_table get_include_path get_magic_quotes_gpc get_magic_quotes_runtime get_meta_tags getcwd getenv gethostbyaddr gethostbyname gethostbynamel gethostname getimagesize getimagesizefromstring getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettimeofday gettype glob header header_register_callback header_remove headers_list headers_sent hebrev hebrevc hex2bin hexdec highlight_file highlight_string html_entity_decode htmlentities htmlspecialchars htmlspecialchars_decode http_build_query http_response_code hypot ignore_user_abort image_type_to_extension image_type_to_mime_type implode in_array inet_ntop inet_pton ini_alter ini_get ini_get_all ini_restore ini_set intdiv intval ip2long iptcembed iptcparse is_array is_bool is_callable is_dir is_double is_executable is_file is_finite is_float is_infinite is_int is_integer is_iterable is_link is_long is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_string is_uploaded_file is_writable is_writeable join key key_exists krsort ksort lcfirst lcg_value lchgrp lchown levenshtein link linkinfo localeconv log log1p log10 long2ip lstat ltrim mail max md5 md5_file memory_get_peak_usage memory_get_usage metaphone microtime min mkdir money_format move_uploaded_file mt_getrandmax mt_rand mt_srand natcasesort natsort next nl2br nl_langinfo number_format ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_implicit_flush ob_list_handlers ob_start octdec opendir openlog ord output_add_rewrite_var output_reset_rewrite_vars pack parse_ini_file parse_ini_string parse_str parse_url passthru password_get_info password_hash password_needs_rehash password_verify pathinfo pclose pfsockopen php_ini_loaded_file php_ini_scanned_files php_sapi_name php_strip_whitespace php_uname phpcredits phpinfo phpversion pi popen pos pow prev print_r printf proc_close proc_get_status proc_nice proc_open proc_terminate putenv quoted_printable_decode quoted_printable_encode quotemeta rad2deg rand random_bytes random_int range rawurldecode rawurlencode readdir readfile readlink realpath realpath_cache_get realpath_cache_size register_shutdown_function register_tick_function rename reset restore_include_path rewind rewinddir rmdir round rsort rtrim scandir serialize set_file_buffer set_include_path set_time_limit setcookie setlocale setrawcookie settype sha1 sha1_file shell_exec show_source shuffle similar_text sin sinh sizeof sleep socket_get_status socket_set_blocking socket_set_timeout sort soundex sprintf sqrt srand sscanf stat str_getcsv str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strchr strcoll strcspn stream_bucket_append stream_bucket_make_writeable stream_bucket_new stream_bucket_prepend stream_context_create stream_context_get_default stream_context_get_options stream_context_get_params stream_context_set_default stream_context_set_option stream_context_set_params stream_copy_to_stream stream_filter_append stream_filter_prepend stream_filter_register stream_filter_remove stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_is_local stream_register_wrapper stream_resolve_include_path stream_select stream_set_blocking stream_set_chunk_size stream_set_read_buffer stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_enable_crypto stream_socket_get_name stream_socket_pair stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_socket_shutdown stream_supports_lock stream_wrapper_register stream_wrapper_restore stream_wrapper_unregister strip_tags stripcslashes stripos stripslashes stristr strnatcasecmp strnatcmp strpbrk strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr strval substr substr_compare substr_count substr_replace symlink sys_get_temp_dir sys_getloadavg syslog system tan tanh tempnam time_nanosleep time_sleep_until tmpfile touch trim uasort ucfirst ucwords uksort umask uniqid unlink unpack unregister_tick_function unserialize urldecode urlencode usleep usort var_dump var_export version_compare vfprintf vprintf vsprintf wordwrap contained +syn keyword phpFunctions abs acos acosh addcslashes addslashes array_change_key_case array_chunk array_column array_combine array_count_values array_diff array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill array_fill_keys array_filter array_flip array_intersect array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map array_merge array_merge_recursive array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace array_replace_recursive array_reverse array_search array_shift array_slice array_splice array_sum array_udiff array_udiff_assoc array_udiff_uassoc array_uintersect array_uintersect_assoc array_uintersect_uassoc array_unique array_unshift array_values array_walk array_walk_recursive arsort asin asinh asort assert assert_options atan atan2 atanh base64_decode base64_encode base_convert basename bin2hex bindec boolval call_user_func call_user_func_array ceil chdir checkdnsrr chgrp chmod chop chown chr chroot chunk_split clearstatcache cli_get_process_title cli_set_process_title closedir closelog compact connection_aborted connection_status constant convert_cyr_string convert_uudecode convert_uuencode copy cos cosh count count_chars crc32 crypt current debug_zval_dump decbin dechex decoct deg2rad dir dirname disk_free_space disk_total_space diskfreespace dl dns_check_record dns_get_mx dns_get_record doubleval end error_clear_last error_get_last error_log escapeshellarg escapeshellcmd exec exp explode expm1 extract ezmlm_hash fclose feof fflush fgetc fgetcsv fgets fgetss file file_exists file_get_contents file_put_contents fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype floatval flock floor flush fmod fnmatch fopen forward_static_call forward_static_call_array fpassthru fprintf fputcsv fputs fread fscanf fseek fsockopen fstat ftell ftok ftruncate fwrite get_browser get_cfg_var get_current_user get_headers get_html_translation_table get_include_path get_magic_quotes_gpc get_magic_quotes_runtime get_meta_tags getcwd getenv gethostbyaddr gethostbyname gethostbynamel gethostname getimagesize getimagesizefromstring getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettimeofday gettype glob header header_register_callback header_remove headers_list headers_sent hebrev hebrevc hex2bin hexdec highlight_file highlight_string html_entity_decode htmlentities htmlspecialchars htmlspecialchars_decode http_build_query http_response_code hypot ignore_user_abort image_type_to_extension image_type_to_mime_type implode in_array inet_ntop inet_pton ini_alter ini_get ini_get_all ini_restore ini_set intdiv intval ip2long iptcembed iptcparse is_array is_bool is_callable is_dir is_double is_executable is_file is_finite is_float is_infinite is_int is_integer is_iterable is_link is_long is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_string is_uploaded_file is_writable is_writeable join key key_exists krsort ksort lcfirst lcg_value lchgrp lchown levenshtein link linkinfo localeconv log log1p log10 long2ip lstat ltrim mail max md5 md5_file memory_get_peak_usage memory_get_usage metaphone microtime min mkdir money_format move_uploaded_file mt_getrandmax mt_rand mt_srand natcasesort natsort next nl2br nl_langinfo number_format ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_implicit_flush ob_list_handlers ob_start octdec opendir openlog ord output_add_rewrite_var output_reset_rewrite_vars pack parse_ini_file parse_ini_string parse_str parse_url passthru password_get_info password_hash password_needs_rehash password_verify pathinfo pclose pfsockopen php_ini_loaded_file php_ini_scanned_files php_sapi_name php_strip_whitespace php_uname phpcredits phpinfo phpversion pi popen pos pow prev print_r printf proc_close proc_get_status proc_nice proc_open proc_terminate putenv quoted_printable_decode quoted_printable_encode quotemeta rad2deg rand random_bytes random_int range rawurldecode rawurlencode readdir readfile readlink realpath realpath_cache_get realpath_cache_size register_shutdown_function register_tick_function rename reset restore_include_path rewind rewinddir rmdir round rsort rtrim scandir serialize set_file_buffer set_include_path set_time_limit setcookie setlocale setrawcookie settype sha1 sha1_file shell_exec show_source shuffle similar_text sin sinh sizeof sleep socket_get_status socket_set_blocking socket_set_timeout sort soundex sprintf sqrt srand sscanf stat str_getcsv str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strchr strcoll strcspn stream_bucket_append stream_bucket_make_writeable stream_bucket_new stream_bucket_prepend stream_context_create stream_context_get_default stream_context_get_options stream_context_get_params stream_context_set_default stream_context_set_option stream_context_set_params stream_copy_to_stream stream_filter_append stream_filter_prepend stream_filter_register stream_filter_remove stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_is_local stream_isatty stream_register_wrapper stream_resolve_include_path stream_select stream_set_blocking stream_set_chunk_size stream_set_read_buffer stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_enable_crypto stream_socket_get_name stream_socket_pair stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_socket_shutdown stream_supports_lock stream_wrapper_register stream_wrapper_restore stream_wrapper_unregister strip_tags stripcslashes stripos stripslashes stristr strnatcasecmp strnatcmp strpbrk strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr strval substr substr_compare substr_count substr_replace symlink sys_get_temp_dir sys_getloadavg syslog system tan tanh tempnam time_nanosleep time_sleep_until tmpfile touch trim uasort ucfirst ucwords uksort umask uniqid unlink unpack unregister_tick_function unserialize urldecode urlencode usleep usort utf8_decode utf8_encode var_dump var_export version_compare vfprintf vprintf vsprintf wordwrap contained " standard classes and interfaces syn keyword phpClasses AssertionError Directory __PHP_Incomplete_Class php_user_filter contained endif @@ -503,7 +505,7 @@ syn keyword phpClasses ZipArchive contained endif if index(g:php_syntax_extensions_enabled, "zlib") >= 0 && index(g:php_syntax_extensions_disabled, "zlib") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "zlib") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "zlib") < 0) " zlib functions -syn keyword phpFunctions deflate_add deflate_init gzclose gzcompress gzdecode gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite inflate_add inflate_init ob_gzhandler readgzfile zlib_decode zlib_encode zlib_get_coding_type contained +syn keyword phpFunctions deflate_add deflate_init gzclose gzcompress gzdecode gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite inflate_add inflate_get_read_len inflate_get_status inflate_init ob_gzhandler readgzfile zlib_decode zlib_encode zlib_get_coding_type contained endif " }}} @@ -535,7 +537,9 @@ syn keyword phpKeyword die exit eval empty isset unset list instanceof insteadof syn keyword phpInclude include include_once require require_once namespace contained " Types -syn keyword phpType bool[ean] int[eger] real double float string array object null self parent global this stdClass callable iterable void contained +syn keyword phpType bool[ean] int[eger] real double float string array object self parent global this stdClass callable iterable void contained +" Special values +syn keyword phpNullValue null contained " Operator syn match phpOperator "[-=+%^&|*!.~?:]" contained display @@ -557,8 +561,7 @@ syn match phpSplatOperator "\.\.\." contained display " Identifier syn match phpIdentifier "$\h\w*" contained contains=phpSuperglobals,phpVarSelector display syn match phpIdentifierSimply "${\h\w*}" contains=phpOperator,phpParent contained display -syn region phpIdentifierComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierArray contained extend -syn region phpIdentifierArray matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained +syn region phpIdentifierComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpIdentifierSimply,phpSpecialChar,phpMethodsVar,phpStringSingle,phpStringDouble,phpBacktick,phpStrEsc contained extend " Boolean syn keyword phpBoolean true false contained @@ -649,29 +652,63 @@ else syn region phpStringSingle matchgroup=phpStringDelimiter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@Spell,@phpAddStrings,phpStrEsc contained keepend extend endif -" HereDoc syn case match -SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend -SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend -" including HTML,JavaScript,SQL if enabled via options -if (exists("php_html_in_heredoc") && php_html_in_heredoc) - SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend - SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend -endif -if (exists("php_sql_heredoc") && php_sql_heredoc) - SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend +" HereDoc +if version >= 704 + " @begin phpHereDoc + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + " including HTML,JavaScript,SQL if enabled via options + if (exists("php_html_in_heredoc") && php_html_in_heredoc) + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + if (exists("php_sql_heredoc") && php_sql_heredoc) + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + " @end phpHereDoc +else + " @copy phpHereDoc strip_maximum_size + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + " including HTML,JavaScript,SQL if enabled via options + if (exists("php_html_in_heredoc") && php_html_in_heredoc) + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + if (exists("php_sql_heredoc") && php_sql_heredoc) + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + " @end phpHereDoc endif " NowDoc -SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend - -if (exists("php_sql_nowdoc") && php_sql_nowdoc) - SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend -endif -if (exists("php_html_in_nowdoc") && php_html_in_nowdoc) - SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend - SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend +if version >= 704 + " @begin phpNowDoc + SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend + " including HTML,JavaScript,SQL if enabled via options + if (exists("php_html_in_nowdoc") && php_html_in_nowdoc) + SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + if (exists("php_sql_nowdoc") && php_sql_nowdoc) + SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + " @end phpNowDoc +else + " @copy phpHereDoc strip_maximum_size + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + " including HTML,JavaScript,SQL if enabled via options + if (exists("php_html_in_heredoc") && php_html_in_heredoc) + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + if (exists("php_sql_heredoc") && php_sql_heredoc) + SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend + endif + " @end phpNowDoc endif syn case ignore @@ -728,7 +765,7 @@ syn keyword phpKeyword function contained syn match phpFunction /\h\w*/ contained " Clusters -syn cluster phpClConst contains=phpFunctions,phpClasses,phpStaticClasses,phpIdentifier,phpStatement,phpKeyword,phpOperator,phpSplatOperator,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstants,phpException,phpSuperglobals,phpMagicConstants,phpServerVars +syn cluster phpClConst contains=phpFunctions,phpClasses,phpStaticClasses,phpIdentifier,phpStatement,phpKeyword,phpOperator,phpSplatOperator,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpType,phpNullValue,phpBoolean,phpStructure,phpMethodsVar,phpConstants,phpException,phpSuperglobals,phpMagicConstants,phpServerVars syn cluster phpClInside contains=@phpClConst,phpComment,phpDocComment,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass,phpKeyword syn cluster phpClControl contains=phpFoldIfContainer,phpFoldWhile,phpFoldDoWhile,phpFoldFor,phpFoldForeach,phpFoldTryContainer,phpFoldSwitch @@ -836,6 +873,7 @@ if !exists("did_php_syn_inits") hi def link phpKeyword Keyword hi def link phpSuperglobals Type hi def link phpType Type + hi def link phpNullValue phpType hi def link phpParent Special hi def link phpSpecialChar SpecialChar hi def link phpStrEsc SpecialChar diff --git a/syntax/purescript.vim b/syntax/purescript.vim index 50e35395..19a5ef65 100644 --- a/syntax/purescript.vim +++ b/syntax/purescript.vim @@ -20,14 +20,8 @@ syn keyword purescriptBoolean true false " Delimiters syn match purescriptDelimiter "[,;|.()[\]{}]" -" Constructor -syn match purescriptConstructor "\%(\<class\s\+\)\@15<!\<[A-Z]\w*\>" -syn region purescriptConstructorDecl matchgroup=purescriptConstructor start="\<[A-Z]\w*\>" end="\(|\|$\)"me=e-1,re=e-1 contained - \ containedin=purescriptData,purescriptNewtype - \ contains=purescriptType,purescriptTypeVar,purescriptDelimiter,purescriptOperatorType,purescriptOperatorTypeSig,@purescriptComment - " Type -syn match purescriptType "\%(\<class\s\+\)\@15<!\<[A-Z]\w*\>" contained +syn match purescriptType "\%(\<class\s\+\)\@15<!\<\u\w*\>" contained \ containedin=purescriptTypeAlias \ nextgroup=purescriptType,purescriptTypeVar skipwhite syn match purescriptTypeVar "\<[_a-z]\(\w\|\'\)*\>" contained @@ -35,6 +29,13 @@ syn match purescriptTypeVar "\<[_a-z]\(\w\|\'\)*\>" contained syn region purescriptTypeExport matchgroup=purescriptType start="\<[A-Z]\(\S\&[^,.]\)*\>("rs=e-1 matchgroup=purescriptDelimiter end=")" contained extend \ contains=purescriptConstructor,purescriptDelimiter +" Constructor +syn match purescriptConstructor "\%(\<class\s\+\)\@15<!\<\u\w*\>" +syn region purescriptConstructorDecl matchgroup=purescriptConstructor start="\<[A-Z]\w*\>" end="\(|\|$\)"me=e-1,re=e-1 contained + \ containedin=purescriptData,purescriptNewtype + \ contains=purescriptType,purescriptTypeVar,purescriptDelimiter,purescriptOperatorType,purescriptOperatorTypeSig,@purescriptComment + + " Function syn match purescriptFunction "\%(\<instance\s\+\|\<class\s\+\)\@18<!\<[_a-z]\(\w\|\'\)*\>" contained " syn match purescriptFunction "\<[_a-z]\(\w\|\'\)*\>" contained @@ -52,28 +53,42 @@ syn match purescriptClass "\<class\>" containedin=purescriptClassDecl contained syn match purescriptClassName "\<[A-Z]\w*\>" containedin=purescriptClassDecl contained " Module -syn match purescriptModuleName "\(\w\+\.\?\)*" contained excludenl +syn match purescriptModuleName "\(\u\w\*\.\?\)*" contained excludenl syn match purescriptModuleKeyword "\<module\>" syn match purescriptModule "^module\>\s\+\<\(\w\+\.\?\)*\>" \ contains=purescriptModuleKeyword,purescriptModuleName - \ nextgroup=purescriptModuleParams skipwhite skipnl skipempty + \ nextgroup=purescriptModuleParams + \ skipwhite + \ skipnl + \ skipempty syn region purescriptModuleParams start="(" skip="([^)]\{-})" end=")" fold contained keepend - \ contains=purescriptClassDecl,purescriptClass,purescriptClassName,purescriptDelimiter,purescriptType,purescriptTypeExport,purescriptFunction,purescriptStructure,purescriptModuleKeyword,@purescriptComment + \ contains=purescriptClassDecl,purescriptClass,purescriptClassName,purescriptDelimiter,purescriptType,purescriptTypeExport,purescriptStructure,purescriptModuleKeyword,@purescriptComment \ nextgroup=purescriptImportParams skipwhite " Import syn match purescriptImportKeyword "\<\(foreign\|import\|qualified\)\>" +syn match purescriptImport "\<import\>\s\+\(qualified\s\+\)\?\<\(\w\+\.\?\)*" + \ contains=purescriptImportKeyword,purescriptModuleName + \ nextgroup=purescriptImportParams,purescriptImportAs,purescriptImportHiding + \ skipwhite +syn region purescriptImportParams + \ start="(" + \ skip="([^)]\{-})" + \ end=")" + \ contained + \ contains=purescriptClass,purescriptClass,purescriptStructure,purescriptType,purescriptIdentifier + \ nextgroup=purescriptImportAs + \ skipwhite syn keyword purescriptAsKeyword as contained +syn match purescriptImportAs "\<as\>\_s\+\u\w*" + \ contains=purescriptAsKeyword,purescriptModuleName + \ nextgroup=purescriptModuleName syn keyword purescriptHidingKeyword hiding contained -syn match purescriptImport "\<import\>\s\+\(qualified\s\+\)\?\<\(\w\+\.\?\)*\>" - \ contains=purescriptImportKeyword,purescriptModuleName - \ nextgroup=purescriptModuleParams,purescriptImportParams skipwhite -syn match purescriptImportParams "as\s\+\(\w\+\)" contained - \ contains=purescriptModuleName,purescriptAsKeyword - \ nextgroup=purescriptModuleParams,purescriptImportParams skipwhite -syn match purescriptImportParams "hiding" contained +syn match purescriptImportHiding "hiding" + \ contained \ contains=purescriptHidingKeyword - \ nextgroup=purescriptModuleParams,purescriptImportParams skipwhite + \ nextgroup=purescriptImportParams + \ skipwhite " Function declaration syn region purescriptFunctionDecl @@ -97,7 +112,6 @@ syn match purescriptForall "∀" syn keyword purescriptConditional if then else syn keyword purescriptStatement do case of in syn keyword purescriptLet let -" syn keyword purescriptClass class syn keyword purescriptWhere where syn match purescriptStructure "\<\(data\|newtype\|type\|kind\)\>" \ nextgroup=purescriptType skipwhite @@ -140,19 +154,22 @@ syn match purescriptTypeAliasStart "^type\s\+\([A-Z]\w*\)" contained " String syn match purescriptChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" -syn region purescriptString start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn region purescriptMultilineString start=+"""+ end=+"""+ fold +syn region purescriptString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell +syn region purescriptMultilineString start=+"""+ end=+"""+ fold contains=@Spell " Comment -syn match purescriptLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" +syn match purescriptLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell syn region purescriptBlockComment start="{-" end="-}" fold - \ contains=purescriptBlockComment -syn cluster purescriptComment contains=purescriptLineComment,purescriptBlockComment + \ contains=purescriptBlockComment,@Spell +syn cluster purescriptComment contains=purescriptLineComment,purescriptBlockComment,@Spell syn sync minlines=50 " highlight links +highlight def link purescriptModule Include +highlight def link purescriptImport Include highlight def link purescriptModuleKeyword purescriptKeyword +highlight def link purescriptImportAs Include highlight def link purescriptModuleName Include highlight def link purescriptModuleParams purescriptDelimiter highlight def link purescriptImportKeyword purescriptKeyword diff --git a/syntax/ruby.vim b/syntax/ruby.vim index da1ad8fc..e61e5f54 100644 --- a/syntax/ruby.vim +++ b/syntax/ruby.vim @@ -280,51 +280,31 @@ else endif " Here Document {{{1 -syn match rubyStringDelimiter +\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ -syn match rubyStringDelimiter +\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ -syn match rubyStringDelimiter +\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ -syn match rubyStringDelimiter +\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop if s:foldable('<<') - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\).*$\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<"\z([^"]*\)".*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<'\z([^']*\)'.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ keepend fold - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<`\z([^`]*\)`.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ contains=@rubyStringSpecial keepend fold - - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\>.*$\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)".*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ keepend fold - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend fold - - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)$+ end=+^\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs"\z([^"]*\)"$+ end=+^\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs'\z([^']*\)'$+ end=+^\z1$+ keepend fold - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs`\z([^`]*\)`$+ end=+^\z1$+ contains=@rubyStringSpecial keepend fold - - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)$+ end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs"\z([^"]*\)"$+ end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend fold - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs'\z([^']*\)'$+ end=+^\s*\zs\z1$+ keepend fold - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs`\z([^`]*\)`$+ end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend fold + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc fold keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend + + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart fold keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend else - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\).*$\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<"\z([^"]*\)".*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<'\z([^']*\)'.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ keepend - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<`\z([^`]*\)`.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\z1$+ contains=@rubyStringSpecial keepend - - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\>.*$\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)".*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ keepend - syn region rubyString start=+\%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`.*\)\@<=\n+ matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend - - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)$+ end=+^\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs"\z([^"]*\)"$+ end=+^\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs'\z([^']*\)'$+ end=+^\z1$+ keepend - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<\zs`\z([^`]*\)`$+ end=+^\z1$+ contains=@rubyStringSpecial keepend - - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)$+ end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs"\z([^"]*\)"$+ end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs'\z([^']*\)'$+ end=+^\s*\zs\z1$+ keepend - syn region rubyString matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\zs`\z([^`]*\)`$+ end=+^\s*\zs\z1$+ contains=@rubyStringSpecial keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend + + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart keepend + syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend endif " eRuby Config {{{1 diff --git a/syntax/solidity.vim b/syntax/solidity.vim index ff47d506..c3bd8a7b 100644 --- a/syntax/solidity.vim +++ b/syntax/solidity.vim @@ -12,9 +12,9 @@ endif " basic " contract, library and event are defined at bottom of file syn keyword solKeyword abstract anonymous as assembly break case catch constant continue default -syn keyword solKeyword delete do else enum external final for function if import in indexed inline +syn keyword solKeyword delete do else emit enum external final for function if import in indexed inline syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure -syn keyword solKeyword relocatable return returns static storage struct switch throw try type typeof using +syn keyword solKeyword relocatable require return returns static storage struct throw try type typeof using syn keyword solKeyword var view while syn keyword solConstant true false wei szabo finney ether seconds minutes hours days weeks years now syn keyword solConstant block msg now tx sha3 keccak256 sha256 ripemd160 ecerecover addmod mulmod this super selfdestruct diff --git a/syntax/swift.vim b/syntax/swift.vim index ef592ce4..92448877 100644 --- a/syntax/swift.vim +++ b/syntax/swift.vim @@ -54,10 +54,10 @@ delfunction s:CommentKeywordMatch " Literals " Strings -syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftMultilineInterpolatedWrapper oneline +syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolatedWrapper oneline syntax region swiftMultilineString start=/"""/ end=/"""/ contains=swiftMultilineInterpolatedWrapper -syntax region swiftMultilineInterpolatedWrapper start="\v\\\(\s*" end="\v\s*\)" contained containedin=swiftMultilineString contains=swiftInterpolatedString oneline -syntax region swiftInterpolatedWrapper start="\v[^\\]\zs\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString,swiftString oneline +syntax region swiftMultilineInterpolatedWrapper start='\v\zs\\\(\s*' end='\v\s*\)' contained containedin=swiftMultilineString contains=swiftInterpolatedString oneline +syntax region swiftInterpolatedWrapper start='\v(^|[^\\])\zs\\\(\s*' end='\v\s*\)' contained containedin=swiftString contains=swiftInterpolatedString,swiftString oneline syntax match swiftInterpolatedString "\v\w+(\(\))?" contained containedin=swiftInterpolatedWrapper,swiftMultilineInterpolatedWrapper oneline " Numbers @@ -140,6 +140,7 @@ syntax keyword swiftKeywords \ mutating \ nil \ nonmutating + \ open \ operator \ optional \ override diff --git a/syntax/terraform.vim b/syntax/terraform.vim index 5e25207f..5508104b 100644 --- a/syntax/terraform.vim +++ b/syntax/terraform.vim @@ -19,9 +19,12 @@ syn keyword terraDataTypeBI \ alicloud_dns_domains \ alicloud_dns_groups \ alicloud_dns_records + \ alicloud_eips \ alicloud_images \ alicloud_instance_types + \ alicloud_instances \ alicloud_key_pairs + \ alicloud_kms_keys \ alicloud_ram_account_alias \ alicloud_ram_account_aliases \ alicloud_ram_groups @@ -29,7 +32,10 @@ syn keyword terraDataTypeBI \ alicloud_ram_roles \ alicloud_ram_users \ alicloud_regions + \ alicloud_security_group_rules + \ alicloud_security_groups \ alicloud_vpcs + \ alicloud_vswitches \ alicloud_zones \ archive_file \ atlas_artifact @@ -39,6 +45,7 @@ syn keyword terraDataTypeBI \ aws_alb_target_group \ aws_ami \ aws_ami_ids + \ aws_api_gateway_rest_api \ aws_autoscaling_groups \ aws_availability_zone \ aws_availability_zones @@ -47,6 +54,7 @@ syn keyword terraDataTypeBI \ aws_canonical_user_id \ aws_cloudformation_stack \ aws_cloudtrail_service_account + \ aws_cloudwatch_log_group \ aws_db_instance \ aws_db_snapshot \ aws_dynamodb_table @@ -60,6 +68,7 @@ syn keyword terraDataTypeBI \ aws_efs_file_system \ aws_efs_mount_target \ aws_eip + \ aws_elastic_beanstalk_hosted_zone \ aws_elastic_beanstalk_solution_stack \ aws_elasticache_cluster \ aws_elasticache_replication_group @@ -69,10 +78,12 @@ syn keyword terraDataTypeBI \ aws_iam_account_alias \ aws_iam_group \ aws_iam_instance_profile + \ aws_iam_policy \ aws_iam_policy_document \ aws_iam_role \ aws_iam_server_certificate \ aws_iam_user + \ aws_inspector_rules_packages \ aws_instance \ aws_instances \ aws_internet_gateway @@ -80,6 +91,7 @@ syn keyword terraDataTypeBI \ aws_kinesis_stream \ aws_kms_alias \ aws_kms_ciphertext + \ aws_kms_key \ aws_kms_secret \ aws_lb \ aws_lb_listener @@ -97,6 +109,7 @@ syn keyword terraDataTypeBI \ aws_s3_bucket_object \ aws_security_group \ aws_sns_topic + \ aws_sqs_queue \ aws_ssm_parameter \ aws_subnet \ aws_subnet_ids @@ -105,58 +118,88 @@ syn keyword terraDataTypeBI \ aws_vpc_endpoint_service \ aws_vpc_peering_connection \ aws_vpn_gateway + \ azurerm_app_service + \ azurerm_app_service_plan + \ azurerm_application_security_group \ azurerm_builtin_role_definition + \ azurerm_cdn_profile \ azurerm_client_config + \ azurerm_dns_zone + \ azurerm_eventhub_namespace \ azurerm_image \ azurerm_key_vault_access_policy \ azurerm_managed_disk + \ azurerm_network_interface \ azurerm_network_security_group \ azurerm_platform_image \ azurerm_public_ip + \ azurerm_public_ips \ azurerm_resource_group \ azurerm_role_definition + \ azurerm_scheduler_job_collection \ azurerm_snapshot + \ azurerm_storage_account \ azurerm_subnet \ azurerm_subscription + \ azurerm_subscriptions + \ azurerm_traffic_manager_geographical_location \ azurerm_virtual_network + \ azurerm_virtual_network_gateway \ circonus_account \ circonus_collector + \ cloudflare_ip_ranges \ cloudstack_template \ consul_agent_self \ consul_catalog_nodes \ consul_catalog_service \ consul_catalog_services + \ consul_key_prefix \ consul_keys \ digitalocean_image \ dns_a_record_set \ dns_aaaa_record_set \ dns_cname_record_set \ dns_ns_record_set + \ dns_ptr_record_set \ dns_txt_record_set \ docker_registry_image \ external \ fastly_ip_ranges + \ github_ip_ranges \ github_team \ github_user \ google_active_folder \ google_billing_account \ google_client_config + \ google_cloudfunctions_function \ google_compute_address + \ google_compute_backend_service + \ google_compute_default_service_account + \ google_compute_forwarding_rule \ google_compute_global_address \ google_compute_image \ google_compute_instance_group \ google_compute_lb_ip_ranges \ google_compute_network \ google_compute_region_instance_group + \ google_compute_ssl_policy \ google_compute_subnetwork + \ google_compute_vpn_gateway \ google_compute_zones \ google_container_cluster \ google_container_engine_versions + \ google_container_registry_image + \ google_container_registry_repository \ google_dns_managed_zone + \ google_folder \ google_iam_policy \ google_kms_secret \ google_organization + \ google_project \ google_storage_object_signed_url + \ google_storage_project_service_account + \ heroku_app + \ heroku_space \ http \ kubernetes_service \ kubernetes_storage_class @@ -164,30 +207,50 @@ syn keyword terraDataTypeBI \ logicmonitor_collectors \ logicmonitor_device_group \ newrelic_application + \ newrelic_key_transaction + \ nomad_regions \ ns1_datasource + \ nsxt_edge_cluster + \ nsxt_logical_tier0_router + \ nsxt_ns_service + \ nsxt_switching_profile + \ nsxt_transport_zone \ null_data_source \ oneandone_instance_size \ opc_compute_image_list_entry + \ opc_compute_machine_image \ opc_compute_network_interface \ opc_compute_storage_volume_snapshot \ opc_compute_vnic + \ openstack_compute_flavor_v2 \ openstack_dns_zone_v2 + \ openstack_identity_project_v3 + \ openstack_identity_role_v3 + \ openstack_identity_user_v3 \ openstack_images_image_v2 \ openstack_networking_network_v2 \ openstack_networking_secgroup_v2 \ openstack_networking_subnet_v2 + \ openstack_networking_subnetpool_v2 \ opentelekomcloud_images_image_v2 + \ opentelekomcloud_kms_data_key_v1 + \ opentelekomcloud_kms_key_v1 \ opentelekomcloud_networking_network_v2 \ opentelekomcloud_networking_secgroup_v2 + \ opentelekomcloud_rds_flavors_v1 \ opentelekomcloud_s3_bucket_object \ opsgenie_user + \ oraclepaas_database_service_instance \ ovh_publiccloud_region \ ovh_publiccloud_regions \ packet_precreated_ip_block \ pagerduty_escalation_policy + \ pagerduty_extension_schema \ pagerduty_schedule + \ pagerduty_team \ pagerduty_user \ pagerduty_vendor + \ panos_system_info \ profitbricks_datacenter \ profitbricks_image \ profitbricks_location @@ -201,13 +264,18 @@ syn keyword terraDataTypeBI \ template_cloudinit_config \ template_file \ terraform_remote_state + \ tls_public_key \ triton_account \ triton_datacenter + \ triton_fabric_network + \ triton_fabric_vlan \ triton_image \ triton_network + \ triton_package \ vsphere_custom_attribute \ vsphere_datacenter \ vsphere_datastore + \ vsphere_datastore_cluster \ vsphere_distributed_virtual_switch \ vsphere_host \ vsphere_network @@ -221,7 +289,16 @@ syn keyword terraDataTypeBI """ resource syn keyword terraResourceTypeBI \ alicloud_cdn_domain + \ alicloud_cms_alarm \ alicloud_container_cluster + \ alicloud_cs_application + \ alicloud_cs_kubernetes + \ alicloud_cs_swarm + \ alicloud_db_account + \ alicloud_db_account_privilege + \ alicloud_db_backup_policy + \ alicloud_db_connection + \ alicloud_db_database \ alicloud_db_instance \ alicloud_disk \ alicloud_disk_attachment @@ -230,6 +307,7 @@ syn keyword terraResourceTypeBI \ alicloud_dns_record \ alicloud_eip \ alicloud_eip_association + \ alicloud_ess_attachment \ alicloud_ess_scaling_configuration \ alicloud_ess_scaling_group \ alicloud_ess_scaling_rule @@ -238,6 +316,7 @@ syn keyword terraResourceTypeBI \ alicloud_instance \ alicloud_key_pair \ alicloud_key_pair_attachment + \ alicloud_kms_key \ alicloud_nat_gateway \ alicloud_oss_bucket \ alicloud_oss_bucket_object @@ -261,14 +340,19 @@ syn keyword terraResourceTypeBI \ alicloud_slb \ alicloud_slb_attachment \ alicloud_slb_listener + \ alicloud_slb_rule + \ alicloud_slb_server_group \ alicloud_snat_entry \ alicloud_subnet \ alicloud_vpc \ alicloud_vswitch \ arukas_container \ atlas_artifact + \ aws_acm_certificate + \ aws_acm_certificate_validation \ aws_alb \ aws_alb_listener + \ aws_alb_listener_certificate \ aws_alb_listener_rule \ aws_alb_target_group \ aws_alb_target_group_attachment @@ -282,6 +366,8 @@ syn keyword terraResourceTypeBI \ aws_api_gateway_base_path_mapping \ aws_api_gateway_client_certificate \ aws_api_gateway_deployment + \ aws_api_gateway_documentation_part + \ aws_api_gateway_documentation_version \ aws_api_gateway_domain_name \ aws_api_gateway_gateway_response \ aws_api_gateway_integration @@ -296,10 +382,13 @@ syn keyword terraResourceTypeBI \ aws_api_gateway_stage \ aws_api_gateway_usage_plan \ aws_api_gateway_usage_plan_key + \ aws_api_gateway_vpc_link \ aws_app_cookie_stickiness_policy \ aws_appautoscaling_policy \ aws_appautoscaling_scheduled_action \ aws_appautoscaling_target + \ aws_appsync_datasource + \ aws_appsync_graphql_api \ aws_athena_database \ aws_athena_named_query \ aws_autoscaling_attachment @@ -311,11 +400,13 @@ syn keyword terraResourceTypeBI \ aws_batch_compute_environment \ aws_batch_job_definition \ aws_batch_job_queue + \ aws_cloud9_environment_ec2 \ aws_cloudformation_stack \ aws_cloudfront_distribution \ aws_cloudfront_origin_access_identity \ aws_cloudtrail \ aws_cloudwatch_dashboard + \ aws_cloudwatch_event_permission \ aws_cloudwatch_event_rule \ aws_cloudwatch_event_target \ aws_cloudwatch_log_destination @@ -335,12 +426,16 @@ syn keyword terraResourceTypeBI \ aws_codepipeline \ aws_cognito_identity_pool \ aws_cognito_identity_pool_roles_attachment + \ aws_cognito_user_group \ aws_cognito_user_pool + \ aws_cognito_user_pool_client + \ aws_cognito_user_pool_domain \ aws_config_config_rule \ aws_config_configuration_recorder \ aws_config_configuration_recorder_status \ aws_config_delivery_channel \ aws_customer_gateway + \ aws_dax_cluster \ aws_db_event_subscription \ aws_db_instance \ aws_db_option_group @@ -355,6 +450,7 @@ syn keyword terraResourceTypeBI \ aws_default_vpc \ aws_default_vpc_dhcp_options \ aws_devicefarm_project + \ aws_directory_service_conditional_forwarder \ aws_directory_service_directory \ aws_dms_certificate \ aws_dms_endpoint @@ -364,7 +460,9 @@ syn keyword terraResourceTypeBI \ aws_dx_connection \ aws_dx_connection_association \ aws_dx_lag + \ aws_dynamodb_global_table \ aws_dynamodb_table + \ aws_dynamodb_table_item \ aws_ebs_snapshot \ aws_ebs_volume \ aws_ecr_lifecycle_policy @@ -397,7 +495,17 @@ syn keyword terraResourceTypeBI \ aws_emr_instance_group \ aws_emr_security_configuration \ aws_flow_log + \ aws_gamelift_alias + \ aws_gamelift_build + \ aws_gamelift_fleet \ aws_glacier_vault + \ aws_glue_catalog_database + \ aws_glue_connection + \ aws_glue_job + \ aws_guardduty_detector + \ aws_guardduty_ipset + \ aws_guardduty_member + \ aws_guardduty_threatintelset \ aws_iam_access_key \ aws_iam_account_alias \ aws_iam_account_password_policy @@ -414,6 +522,7 @@ syn keyword terraResourceTypeBI \ aws_iam_role_policy_attachment \ aws_iam_saml_provider \ aws_iam_server_certificate + \ aws_iam_service_linked_role \ aws_iam_user \ aws_iam_user_login_profile \ aws_iam_user_policy @@ -426,19 +535,25 @@ syn keyword terraResourceTypeBI \ aws_internet_gateway \ aws_iot_certificate \ aws_iot_policy + \ aws_iot_thing + \ aws_iot_thing_type + \ aws_iot_topic_rule \ aws_key_pair \ aws_kinesis_firehose_delivery_stream \ aws_kinesis_stream \ aws_kms_alias + \ aws_kms_grant \ aws_kms_key \ aws_lambda_alias \ aws_lambda_event_source_mapping \ aws_lambda_function \ aws_lambda_permission \ aws_launch_configuration + \ aws_launch_template \ aws_lb \ aws_lb_cookie_stickiness_policy \ aws_lb_listener + \ aws_lb_listener_certificate \ aws_lb_listener_rule \ aws_lb_ssl_negotiation_policy \ aws_lb_target_group @@ -477,6 +592,8 @@ syn keyword terraResourceTypeBI \ aws_opsworks_stack \ aws_opsworks_static_web_layer \ aws_opsworks_user_profile + \ aws_organizations_account + \ aws_organizations_organization \ aws_placement_group \ aws_proxy_protocol_policy \ aws_rds_cluster @@ -489,12 +606,14 @@ syn keyword terraResourceTypeBI \ aws_route \ aws_route53_delegation_set \ aws_route53_health_check + \ aws_route53_query_log \ aws_route53_record \ aws_route53_zone \ aws_route53_zone_association \ aws_route_table \ aws_route_table_association \ aws_s3_bucket + \ aws_s3_bucket_metric \ aws_s3_bucket_notification \ aws_s3_bucket_object \ aws_s3_bucket_policy @@ -502,12 +621,15 @@ syn keyword terraResourceTypeBI \ aws_security_group_rule \ aws_service_discovery_private_dns_namespace \ aws_service_discovery_public_dns_namespace + \ aws_service_discovery_service \ aws_servicecatalog_portfolio \ aws_ses_active_receipt_rule_set \ aws_ses_configuration_set \ aws_ses_domain_dkim \ aws_ses_domain_identity + \ aws_ses_domain_mail_from \ aws_ses_event_destination + \ aws_ses_identity_notification_topic \ aws_ses_receipt_filter \ aws_ses_receipt_rule \ aws_ses_receipt_rule_set @@ -516,6 +638,7 @@ syn keyword terraResourceTypeBI \ aws_sfn_state_machine \ aws_simpledb_domain \ aws_snapshot_create_volume_permission + \ aws_sns_platform_application \ aws_sns_topic \ aws_sns_topic_policy \ aws_sns_topic_subscription @@ -540,7 +663,11 @@ syn keyword terraResourceTypeBI \ aws_vpc_dhcp_options \ aws_vpc_dhcp_options_association \ aws_vpc_endpoint + \ aws_vpc_endpoint_connection_notification \ aws_vpc_endpoint_route_table_association + \ aws_vpc_endpoint_service + \ aws_vpc_endpoint_service_allowed_principal + \ aws_vpc_endpoint_subnet_association \ aws_vpc_peering_connection \ aws_vpc_peering_connection_accepter \ aws_vpn_connection @@ -549,15 +676,30 @@ syn keyword terraResourceTypeBI \ aws_vpn_gateway_attachment \ aws_vpn_gateway_route_propagation \ aws_waf_byte_match_set + \ aws_waf_geo_match_set \ aws_waf_ipset \ aws_waf_rate_based_rule + \ aws_waf_regex_match_set + \ aws_waf_regex_pattern_set \ aws_waf_rule + \ aws_waf_rule_group \ aws_waf_size_constraint_set \ aws_waf_sql_injection_match_set \ aws_waf_web_acl \ aws_waf_xss_match_set \ aws_wafregional_byte_match_set + \ aws_wafregional_geo_match_set \ aws_wafregional_ipset + \ aws_wafregional_rate_based_rule + \ aws_wafregional_regex_match_set + \ aws_wafregional_regex_pattern_set + \ aws_wafregional_rule + \ aws_wafregional_rule_group + \ aws_wafregional_size_constraint_set + \ aws_wafregional_sql_injection_match_set + \ aws_wafregional_web_acl + \ aws_wafregional_web_acl_association + \ aws_wafregional_xss_match_set \ azure_affinity_group \ azure_data_disk \ azure_dns_server @@ -575,9 +717,13 @@ syn keyword terraResourceTypeBI \ azure_storage_service \ azure_virtual_network \ azurerm_app_service + \ azurerm_app_service_active_slot + \ azurerm_app_service_custom_hostname_binding \ azurerm_app_service_plan + \ azurerm_app_service_slot \ azurerm_application_gateway \ azurerm_application_insights + \ azurerm_application_security_group \ azurerm_automation_account \ azurerm_automation_credential \ azurerm_automation_runbook @@ -604,11 +750,16 @@ syn keyword terraResourceTypeBI \ azurerm_eventhub_consumer_group \ azurerm_eventhub_namespace \ azurerm_express_route_circuit + \ azurerm_express_route_circuit_authorization + \ azurerm_express_route_circuit_peering + \ azurerm_function_app \ azurerm_image + \ azurerm_iothub \ azurerm_key_vault \ azurerm_key_vault_certificate \ azurerm_key_vault_key \ azurerm_key_vault_secret + \ azurerm_kubernetes_cluster \ azurerm_lb \ azurerm_lb_backend_address_pool \ azurerm_lb_nat_pool @@ -616,9 +767,11 @@ syn keyword terraResourceTypeBI \ azurerm_lb_probe \ azurerm_lb_rule \ azurerm_local_network_gateway + \ azurerm_log_analytics_solution \ azurerm_log_analytics_workspace \ azurerm_managed_disk \ azurerm_management_lock + \ azurerm_metric_alertrule \ azurerm_mysql_configuration \ azurerm_mysql_database \ azurerm_mysql_firewall_rule @@ -627,6 +780,9 @@ syn keyword terraResourceTypeBI \ azurerm_network_security_group \ azurerm_network_security_rule \ azurerm_network_watcher + \ azurerm_packet_capture + \ azurerm_policy_assignment + \ azurerm_policy_definition \ azurerm_postgresql_configuration \ azurerm_postgresql_database \ azurerm_postgresql_firewall_rule @@ -639,16 +795,20 @@ syn keyword terraResourceTypeBI \ azurerm_role_definition \ azurerm_route \ azurerm_route_table + \ azurerm_scheduler_job_collection \ azurerm_search_service \ azurerm_servicebus_namespace \ azurerm_servicebus_queue \ azurerm_servicebus_subscription \ azurerm_servicebus_topic + \ azurerm_servicebus_topic_authorization_rule \ azurerm_snapshot + \ azurerm_sql_active_directory_administrator \ azurerm_sql_database \ azurerm_sql_elasticpool \ azurerm_sql_firewall_rule \ azurerm_sql_server + \ azurerm_sql_virtual_network_rule \ azurerm_storage_account \ azurerm_storage_blob \ azurerm_storage_container @@ -663,6 +823,8 @@ syn keyword terraResourceTypeBI \ azurerm_virtual_machine_extension \ azurerm_virtual_machine_scale_set \ azurerm_virtual_network + \ azurerm_virtual_network_gateway + \ azurerm_virtual_network_gateway_connection \ azurerm_virtual_network_peering \ bitbucket_default_reviewers \ bitbucket_hook @@ -686,7 +848,13 @@ syn keyword terraResourceTypeBI \ clc_load_balancer_pool \ clc_public_ip \ clc_server + \ cloudflare_load_balancer + \ cloudflare_load_balancer_monitor + \ cloudflare_load_balancer_pool + \ cloudflare_page_rule + \ cloudflare_rate_limit \ cloudflare_record + \ cloudflare_zone_settings_override \ cloudscale_floating_ip \ cloudscale_server \ cloudstack_affinity_group @@ -775,6 +943,8 @@ syn keyword terraResourceTypeBI \ google_bigquery_table \ google_bigtable_instance \ google_bigtable_table + \ google_cloudfunctions_function + \ google_cloudiot_registry \ google_compute_address \ google_compute_autoscaler \ google_compute_backend_bucket @@ -803,10 +973,12 @@ syn keyword terraResourceTypeBI \ google_compute_router \ google_compute_router_interface \ google_compute_router_peer + \ google_compute_security_policy \ google_compute_shared_vpc_host_project \ google_compute_shared_vpc_service_project \ google_compute_snapshot \ google_compute_ssl_certificate + \ google_compute_ssl_policy \ google_compute_subnetwork \ google_compute_target_http_proxy \ google_compute_target_https_proxy @@ -818,24 +990,29 @@ syn keyword terraResourceTypeBI \ google_compute_vpn_tunnel \ google_container_cluster \ google_container_node_pool + \ google_dataflow_job \ google_dataproc_cluster \ google_dataproc_job \ google_dns_managed_zone \ google_dns_record_set + \ google_endpoints_service \ google_folder \ google_folder_organization_policy \ google_kms_crypto_key \ google_kms_key_ring \ google_logging_billing_account_sink \ google_logging_folder_sink + \ google_logging_organization_sink \ google_logging_project_sink \ google_organization_iam_custom_role \ google_organization_policy \ google_project \ google_project_iam_custom_role \ google_project_iam_policy + \ google_project_organization_policy \ google_project_service \ google_project_services + \ google_project_usage_export_bucket \ google_pubsub_subscription \ google_pubsub_topic \ google_runtimeconfig_config @@ -851,6 +1028,8 @@ syn keyword terraResourceTypeBI \ google_storage_bucket \ google_storage_bucket_acl \ google_storage_bucket_object + \ google_storage_default_object_acl + \ google_storage_notification \ google_storage_object_acl \ heroku_addon \ heroku_addon_attachment @@ -901,6 +1080,7 @@ syn keyword terraResourceTypeBI \ local_file \ logentries_log \ logentries_logset + \ logicmonitor_collector \ logicmonitor_collector_group \ logicmonitor_device \ logicmonitor_device_group @@ -912,8 +1092,34 @@ syn keyword terraResourceTypeBI \ newrelic_alert_condition \ newrelic_alert_policy \ newrelic_alert_policy_channel + \ newrelic_dashboard \ newrelic_nrql_alert_condition + \ nomad_acl_policy + \ nomad_acl_token \ nomad_job + \ nomad_namespace + \ nomad_quota_specification + \ nomad_sentinel_policy + \ nsxt_algorithm_type_ns_service + \ nsxt_dhcp_relay_profile + \ nsxt_dhcp_relay_service + \ nsxt_ether_type_ns_service + \ nsxt_firewall_section + \ nsxt_icmp_type_ns_service + \ nsxt_igmp_type_ns_service + \ nsxt_ip_protocol_ns_service + \ nsxt_ip_set + \ nsxt_l4_port_set_ns_service + \ nsxt_logical_port + \ nsxt_logical_router_downlink_port + \ nsxt_logical_router_link_port_on_tier0 + \ nsxt_logical_router_link_port_on_tier1 + \ nsxt_logical_switch + \ nsxt_logical_tier1_router + \ nsxt_nat_rule + \ nsxt_ns_group + \ nsxt_static_route + \ nsxt_vm_tags \ null_resource \ oneandone_firewall_policy \ oneandone_loadbalancer @@ -934,6 +1140,7 @@ syn keyword terraResourceTypeBI \ opc_compute_ip_network \ opc_compute_ip_network_exchange \ opc_compute_ip_reservation + \ opc_compute_machine_image \ opc_compute_orchestrated_instance \ opc_compute_route \ opc_compute_sec_rule @@ -945,6 +1152,7 @@ syn keyword terraResourceTypeBI \ opc_compute_security_rule \ opc_compute_snapshot \ opc_compute_ssh_key + \ opc_compute_storage_attachment \ opc_compute_storage_volume \ opc_compute_storage_volume_snapshot \ opc_compute_vnic_set @@ -961,14 +1169,17 @@ syn keyword terraResourceTypeBI \ openstack_compute_secgroup_v2 \ openstack_compute_servergroup_v2 \ openstack_compute_volume_attach_v2 + \ openstack_db_configuration_v1 \ openstack_db_database_v1 \ openstack_db_instance_v1 + \ openstack_db_user_v1 \ openstack_dns_recordset_v2 \ openstack_dns_zone_v2 \ openstack_fw_firewall_v1 \ openstack_fw_policy_v1 \ openstack_fw_rule_v1 \ openstack_identity_project_v3 + \ openstack_identity_role_v3 \ openstack_identity_user_v3 \ openstack_images_image_v2 \ openstack_lb_listener_v2 @@ -989,6 +1200,7 @@ syn keyword terraResourceTypeBI \ openstack_networking_secgroup_rule_v2 \ openstack_networking_secgroup_v2 \ openstack_networking_subnet_v2 + \ openstack_networking_subnetpool_v2 \ openstack_objectstorage_container_v1 \ openstack_objectstorage_object_v1 \ opentelekomcloud_blockstorage_volume_v2 @@ -1010,6 +1222,7 @@ syn keyword terraResourceTypeBI \ opentelekomcloud_fw_policy_v2 \ opentelekomcloud_fw_rule_v2 \ opentelekomcloud_images_image_v2 + \ opentelekomcloud_kms_key_v1 \ opentelekomcloud_lb_listener_v2 \ opentelekomcloud_lb_loadbalancer_v2 \ opentelekomcloud_lb_member_v2 @@ -1024,13 +1237,19 @@ syn keyword terraResourceTypeBI \ opentelekomcloud_networking_secgroup_rule_v2 \ opentelekomcloud_networking_secgroup_v2 \ opentelekomcloud_networking_subnet_v2 + \ opentelekomcloud_rds_instance_v1 \ opentelekomcloud_s3_bucket \ opentelekomcloud_s3_bucket_object \ opentelekomcloud_s3_bucket_policy \ opentelekomcloud_smn_subscription_v2 \ opentelekomcloud_smn_topic_v2 + \ opentelekomcloud_vpc_eip_v1 \ opsgenie_team \ opsgenie_user + \ oraclepaas_database_access_rule + \ oraclepaas_database_service_instance + \ oraclepaas_java_access_rule + \ oraclepaas_java_service_instance \ ovh_domain_zone_record \ ovh_publiccloud_private_network \ ovh_publiccloud_private_network_subnet @@ -1045,6 +1264,7 @@ syn keyword terraResourceTypeBI \ packet_volume_attachment \ pagerduty_addon \ pagerduty_escalation_policy + \ pagerduty_extension \ pagerduty_maintenance_window \ pagerduty_schedule \ pagerduty_service @@ -1052,6 +1272,20 @@ syn keyword terraResourceTypeBI \ pagerduty_team \ pagerduty_team_membership \ pagerduty_user + \ pagerduty_user_contact_method + \ panos_address_group + \ panos_address_object + \ panos_administrative_tag + \ panos_dag_tags + \ panos_ethernet_interface + \ panos_general_settings + \ panos_management_profile + \ panos_nat_policy + \ panos_security_policies + \ panos_service_group + \ panos_service_object + \ panos_virtual_router + \ panos_zone \ postgresql_database \ postgresql_extension \ postgresql_role @@ -1099,6 +1333,9 @@ syn keyword terraResourceTypeBI \ scaleway_security_group \ scaleway_security_group_rule \ scaleway_server + \ scaleway_ssh_key + \ scaleway_token + \ scaleway_user_data \ scaleway_volume \ scaleway_volume_attachment \ softlayer_ssh_key @@ -1133,6 +1370,7 @@ syn keyword terraResourceTypeBI \ vcd_vapp_vm \ vsphere_custom_attribute \ vsphere_datacenter + \ vsphere_datastore_cluster \ vsphere_distributed_port_group \ vsphere_distributed_virtual_switch \ vsphere_file @@ -1141,6 +1379,7 @@ syn keyword terraResourceTypeBI \ vsphere_host_virtual_switch \ vsphere_license \ vsphere_nas_datastore + \ vsphere_storage_drs_vm_override \ vsphere_tag \ vsphere_tag_category \ vsphere_virtual_disk diff --git a/syntax/typescript.vim b/syntax/typescript.vim index 144b72d4..0a2d2985 100644 --- a/syntax/typescript.vim +++ b/syntax/typescript.vim @@ -67,6 +67,7 @@ syn region typescriptInterpolation matchgroup=typescriptInterpolationDelimiter \ start=/${/ end=/}/ contained \ contains=@typescriptExpression +syn match typescriptNumber "-\=\<\d[0-9_]*L\=\>" display syn match typescriptNumber "-\=\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>" display syn match typescriptNumber "-\=\<0[bB][01][01_]*\>" display syn match typescriptNumber "-\=\<0[oO]\o[0-7_]*\>" display diff --git a/syntax/vifm.vim b/syntax/vifm.vim index c585ccd8..9eae9a92 100644 --- a/syntax/vifm.vim +++ b/syntax/vifm.vim @@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1 " vifm syntax file " Maintainer: xaizek <xaizek@posteo.net> -" Last Change: September 18, 2017 +" Last Change: April 18, 2018 " Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr. if exists('b:current_syntax') @@ -18,11 +18,12 @@ set cpo-=C syntax keyword vifmCommand contained alink apropos bmark bmarks bmgo change \ chmod chown clone compare cope[n] co[py] cq[uit] d[elete] delbmarks \ delm[arks] di[splay] dirs e[dit] el[se] empty en[dif] exi[t] file fin[d] - \ fini[sh] gr[ep] h[elp] histnext his[tory] histprev jobs locate ls lstrash - \ marks mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd pu[t] pw[d] - \ q[uit] redr[aw] reg[isters] rename restart restore rlink screen sh[ell] - \ siblnext siblprev sor[t] sp[lit] s[ubstitute] touch tr trashes tree sync - \ undol[ist] ve[rsion] vie[w] vifm vs[plit] winc[md] w[rite] wq x[it] y[ank] + \ fini[sh] go[to] gr[ep] h[elp] histnext his[tory] histprev jobs locate ls + \ lstrash marks mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd pu[t] + \ pw[d] qa[ll] q[uit] redr[aw] reg[isters] rename restart restore rlink + \ screen sh[ell] siblnext siblprev sor[t] sp[lit] s[ubstitute] tabc[lose] + \ tabm[ove] tabname tabnew touch tr trashes tree sync undol[ist] ve[rsion] + \ vie[w] vifm vs[plit] winc[md] w[rite] wq wqa[ll] xa[ll] x[it] y[ank] \ nextgroup=vifmArgs " commands that might be prepended to a command without changing everything else @@ -63,7 +64,7 @@ syntax case match " Builtin functions syntax match vifmBuiltinFunction - \ '\(chooseopt\|expand\|executable\|filetype\|getpanetype\|has\|layoutis\|paneisat\|system\|term\)\ze(' + \ '\(chooseopt\|expand\|executable\|filetype\|fnameescape\|getpanetype\|has\|layoutis\|paneisat\|system\|tabpagenr\|term\)\ze(' " Operators syntax match vifmOperator "\(==\|!=\|>=\?\|<=\?\|\.\|-\|+\|&&\|||\)" skipwhite @@ -74,7 +75,7 @@ syntax case ignore syntax keyword vifmHiGroups contained WildMenu Border Win CmdLine CurrLine \ OtherLine Directory Link Socket Device Executable Selected BrokenLink \ TopLine TopLineSel StatusLine JobLine SuggestBox Fifo ErrorMsg CmpMismatch - \ AuxWin + \ AuxWin TabLine TabLineSel syntax keyword vifmHiStyles contained bold underline reverse inverse standout \ none syntax keyword vifmHiColors contained black red green yellow blue magenta cyan @@ -124,31 +125,32 @@ syntax case match syntax keyword vifmOption contained aproposprg autochpos caseoptions cdpath cd \ chaselinks classify columns co confirm cf cpoptions cpo cvoptions \ deleteprg dotdirs dotfiles dirsize fastrun fillchars fcs findprg - \ followlinks fusehome gdefault grepprg history hi hlsearch hls iec - \ ignorecase ic iooptions incsearch is laststatus lines locateprg ls + \ followlinks fusehome gdefault grepprg histcursor history hi hlsearch hls + \ iec ignorecase ic iooptions incsearch is laststatus lines locateprg ls \ lsoptions lsview milleroptions millerview mintimeoutlen number nu - \ numberwidth nuw previewprg relativenumber rnu rulerformat ruf runexec - \ scrollbind scb scrolloff so sort sortgroups sortorder sortnumbers shell sh - \ shortmess shm sizefmt slowfs smartcase scs statusline stl suggestoptions - \ syscalls tabstop timefmt timeoutlen title tm trash trashdir ts tuioptions - \ to undolevels ul vicmd viewcolumns vifminfo vimhelp vixcmd wildmenu wmnu - \ wildstyle wordchars wrap wrapscan ws + \ numberwidth nuw previewprg quickview relativenumber rnu rulerformat ruf + \ runexec scrollbind scb scrolloff so sort sortgroups sortorder sortnumbers + \ shell sh shortmess shm showtabline stal sizefmt slowfs smartcase scs + \ statusline stl suggestoptions syncregs syscalls tabscope tabstop timefmt + \ timeoutlen title tm trash trashdir ts tuioptions to undolevels ul vicmd + \ viewcolumns vifminfo vimhelp vixcmd wildmenu wmnu wildstyle wordchars wrap + \ wrapscan ws " Disabled boolean options syntax keyword vifmOption contained noautochpos nocf nochaselinks nodotfiles \ nofastrun nofollowlinks nohlsearch nohls noiec noignorecase noic \ noincsearch nois nolaststatus nols nolsview nomillerview nonumber nonu - \ norelativenumber nornu noscrollbind noscb norunexec nosmartcase noscs - \ nosortnumbers nosyscalls notitle notrash novimhelp nowildmenu nowmnu - \ nowrap nowrapscan nows + \ noquickview norelativenumber nornu noscrollbind noscb norunexec + \ nosmartcase noscs nosortnumbers nosyscalls notitle notrash novimhelp + \ nowildmenu nowmnu nowrap nowrapscan nows " Inverted boolean options syntax keyword vifmOption contained invautochpos invcf invchaselinks invdotfiles \ invfastrun invfollowlinks invhlsearch invhls inviec invignorecase invic \ invincsearch invis invlaststatus invls invlsview invmillerview invnumber - \ invnu invrelativenumber invrnu invscrollbind invscb invrunexec invsmartcase - \ invscs invsortnumbers invsyscalls invtitle invtrash invvimhelp invwildmenu - \ invwmnu invwrap invwrapscan invws + \ invnu invquickview invrelativenumber invrnu invscrollbind invscb + \ invrunexec invsmartcase invscs invsortnumbers invsyscalls invtitle + \ invtrash invvimhelp invwildmenu invwmnu invwrap invwrapscan invws " Expressions syntax region vifmStatement start='^\(\s\|:\)*' @@ -372,7 +374,7 @@ syntax match vifmNumber contained /\d\+/ " Ange-bracket notation syntax case ignore -syntax match vifmNotation '<\(esc\|cr\|space\|del\|nop\|\(s-\)\?tab\|home\|end\|left\|right\|up\|down\|bs\|delete\|pageup\|pagedown\|\([acms]-\)\?f\d\{1,2\}\|c-s-[a-z[\]^_]\|s-c-[a-z[\]^_]\|c-[a-z[\]^_]\|[am]-c-[a-z]\|c-[am]-[a-z]\|[am]-[a-z]\)>' +syntax match vifmNotation '<\(esc\|cr\|space\|del\|nop\|\(s-\)\?tab\|home\|end\|left\|right\|up\|down\|bs\|delete\|insert\|pageup\|pagedown\|\([acms]-\)\?f\d\{1,2\}\|c-s-[a-z[\]^_]\|s-c-[a-z[\]^_]\|c-[a-z[\]^_]\|[am]-c-[a-z]\|c-[am]-[a-z]\|[am]-[a-z]\)>' syntax case match " Whole line comment diff --git a/syntax/vue.vim b/syntax/vue.vim index 8af0a5b9..7dfefdb2 100644 --- a/syntax/vue.vim +++ b/syntax/vue.vim @@ -9,6 +9,8 @@ if exists("b:current_syntax") endif runtime! syntax/html.vim +syntax clear htmlTagName +syntax match htmlTagName contained "\<[a-zA-Z0-9:-]*\>" unlet! b:current_syntax "" @@ -43,6 +45,7 @@ function! s:register_language(language, tag, ...) endfunction if !exists("g:vue_disable_pre_processors") || !g:vue_disable_pre_processors + call s:register_language('less', 'style') call s:register_language('pug', 'template', s:attr('lang', '\%(pug\|jade\)')) call s:register_language('slm', 'template') call s:register_language('handlebars', 'template') @@ -52,7 +55,6 @@ if !exists("g:vue_disable_pre_processors") || !g:vue_disable_pre_processors call s:register_language('stylus', 'style') call s:register_language('sass', 'style') call s:register_language('scss', 'style') - call s:register_language('less', 'style') endif syn region vueSurroundingTag contained start=+<\(script\|style\|template\)+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent |