From 0801eac01aab5940fc1e4409ba749383cc353bc2 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 23 Mar 2017 11:28:19 +0100 Subject: Update --- syntax/blade.vim | 10 +- syntax/coffee.vim | 2 +- syntax/erlang.vim | 227 +++++++++++++++++++++----------------------- syntax/haskell.vim | 6 +- syntax/html.vim | 22 +++-- syntax/html/aria.vim | 25 +++-- syntax/html/electron.vim | 19 ++++ syntax/javascript.vim | 27 +++--- syntax/javascript/html5.vim | 3 + syntax/layout/nginx.vim | 103 +++++++++++++------- syntax/litcoffee.vim | 27 ++++++ syntax/markdown.vim | 4 +- syntax/modules/afcgi.vim | 4 +- syntax/modules/geoip2.vim | 43 ++++++++- syntax/nginx.vim | 150 +++++++++++++++++++++-------- syntax/plantuml.vim | 4 +- syntax/pug.vim | 12 +-- syntax/swift.vim | 2 +- syntax/terraform.vim | 64 ++++++++++++- syntax/typescript.vim | 4 +- syntax/vala.vim | 14 ++- syntax/vue.vim | 60 +++++------- 22 files changed, 546 insertions(+), 286 deletions(-) create mode 100644 syntax/html/electron.vim create mode 100644 syntax/litcoffee.vim (limited to 'syntax') diff --git a/syntax/blade.vim b/syntax/blade.vim index 4c04db75..7ae2786a 100644 --- a/syntax/blade.vim +++ b/syntax/blade.vim @@ -32,13 +32,13 @@ syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" con syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend 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 + \ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue + \ @unset @lang @choice @component @slot @prepend \ 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 @empty @endforelse @endwhile @endcan \ @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim @endcomponent - \ @endslot + \ @endslot @endprepend \ containedin=ALLBUT,@bladeExempt if exists('g:blade_custom_directives') @@ -49,7 +49,7 @@ if exists('g:blade_custom_directives_pairs') exe "syn keyword bladeKeyword @" . join(values(g:blade_custom_directives_pairs), ' @') . " containedin=ALLBUT,@bladeExempt" endif -syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\%(\s*(\)\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend +syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\s*(\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend syn match bladeKeyword "@php\ze\s*(" nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained diff --git a/syntax/coffee.vim b/syntax/coffee.vim index 589b8534..f11a7c50 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\)\>/ +syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\|await\)\>/ \ display " The `own` keyword is only a keyword after `for`. syn match coffeeKeyword /\/ contained containedin=coffeeRepeat diff --git a/syntax/erlang.vim b/syntax/erlang.vim index 57b0a6a6..c01c0b2f 100644 --- a/syntax/erlang.vim +++ b/syntax/erlang.vim @@ -4,9 +4,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1 " Language: Erlang (http://www.erlang.org) " Maintainer: Csaba Hoch " Contributor: Adam Rutkowski -" Last Update: 2013-Nov-23 +" Last Update: 2017-Mar-05 " License: Vim license -" URL: https://github.com/hcs42/vim-erlang +" URL: https://github.com/vim-erlang/vim-erlang-runtime " Acknowledgements: This script was originally created by Kresimir Marzic [1]. " The script was then revamped by Csaba Hoch [2]. During the revamp, the new @@ -31,11 +31,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1 " " syn keyword erlangAttribute myattr1 myattr2 contained -" 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") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -45,9 +42,7 @@ set cpo&vim " Case sensitive syn case match -if version >= 600 - setlocal iskeyword+=$,@-@ -endif +setlocal iskeyword+=$,@-@ " Comments syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo @@ -88,6 +83,7 @@ syn match erlangMacro '??\=[[:alnum:]_@]\+' syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+' syn match erlangMap '#' syn match erlangRecord '#\s*\l[[:alnum:]_@]*' +syn region erlangQuotedRecord start=/#\s*'/ end=/'/ contains=erlangQuotedAtomModifier " Shebang (this line has to be after the ErlangMap) syn match erlangShebang '^#!.*' @@ -153,118 +149,109 @@ let b:erlang_syntax_synced = 1 let s:old_style = (exists("g:erlang_old_style_highlight") && \g:erlang_old_style_highlight == 1) -" 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_erlang_inits") - if version < 508 - let did_erlang_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " Comments - HiLink erlangComment Comment - HiLink erlangCommentAnnotation Special - HiLink erlangTodo Todo - HiLink erlangShebang Comment - - " Numbers - HiLink erlangNumberInteger Number - HiLink erlangNumberFloat Float - - " Strings, atoms, characters - HiLink erlangString String - - if s:old_style - HiLink erlangQuotedAtom Type - else - HiLink erlangQuotedAtom String - endif - - HiLink erlangStringModifier Special - HiLink erlangQuotedAtomModifier Special - HiLink erlangModifier Special - - " Operators, separators - HiLink erlangOperator Operator - HiLink erlangRightArrow Operator - if s:old_style - HiLink erlangBracket Normal - HiLink erlangPipe Normal - else - HiLink erlangBracket Delimiter - HiLink erlangPipe Delimiter - endif - - " Atoms, functions, variables, macros - if s:old_style - HiLink erlangAtom Normal - HiLink erlangLocalFuncCall Normal - HiLink erlangLocalFuncRef Normal - HiLink erlangGlobalFuncCall Function - HiLink erlangGlobalFuncRef Function - HiLink erlangVariable Normal - HiLink erlangMacro Normal - HiLink erlangRecord Normal - HiLink erlangMap Normal - else - HiLink erlangAtom String - HiLink erlangLocalFuncCall Normal - HiLink erlangLocalFuncRef Normal - HiLink erlangGlobalFuncCall Normal - HiLink erlangGlobalFuncRef Normal - HiLink erlangVariable Identifier - HiLink erlangMacro Macro - HiLink erlangRecord Structure - HiLink erlangMap Structure - endif - - " Bitstrings - if !s:old_style - HiLink erlangBitType Type - endif - - " Constants and Directives - if s:old_style - HiLink erlangAttribute Type - HiLink erlangMacroDef Type - HiLink erlangUnknownAttribute Normal - HiLink erlangInclude Type - HiLink erlangRecordDef Type - HiLink erlangDefine Type - HiLink erlangPreCondit Type - HiLink erlangType Type - else - HiLink erlangAttribute Keyword - HiLink erlangMacroDef Macro - HiLink erlangUnknownAttribute Normal - HiLink erlangInclude Include - HiLink erlangRecordDef Keyword - HiLink erlangDefine Define - HiLink erlangPreCondit PreCondit - HiLink erlangType Type - endif - - " Keywords - HiLink erlangKeyword Keyword - - " Build-in-functions (BIFs) - HiLink erlangBIF Function - - if s:old_style - HiLink erlangBoolean Statement - HiLink erlangExtra Statement - HiLink erlangSignal Statement - else - HiLink erlangBoolean Boolean - HiLink erlangExtra Statement - HiLink erlangSignal Statement - endif - - delcommand HiLink + +" Comments +hi def link erlangComment Comment +hi def link erlangCommentAnnotation Special +hi def link erlangTodo Todo +hi def link erlangShebang Comment + +" Numbers +hi def link erlangNumberInteger Number +hi def link erlangNumberFloat Float + +" Strings, atoms, characters +hi def link erlangString String + +if s:old_style +hi def link erlangQuotedAtom Type +else +hi def link erlangQuotedAtom String +endif + +hi def link erlangStringModifier Special +hi def link erlangQuotedAtomModifier Special +hi def link erlangModifier Special + +" Operators, separators +hi def link erlangOperator Operator +hi def link erlangRightArrow Operator +if s:old_style +hi def link erlangBracket Normal +hi def link erlangPipe Normal +else +hi def link erlangBracket Delimiter +hi def link erlangPipe Delimiter +endif + +" Atoms, functions, variables, macros +if s:old_style +hi def link erlangAtom Normal +hi def link erlangLocalFuncCall Normal +hi def link erlangLocalFuncRef Normal +hi def link erlangGlobalFuncCall Function +hi def link erlangGlobalFuncRef Function +hi def link erlangVariable Normal +hi def link erlangMacro Normal +hi def link erlangRecord Normal +hi def link erlangQuotedRecord Normal +hi def link erlangMap Normal +else +hi def link erlangAtom String +hi def link erlangLocalFuncCall Normal +hi def link erlangLocalFuncRef Normal +hi def link erlangGlobalFuncCall Normal +hi def link erlangGlobalFuncRef Normal +hi def link erlangVariable Identifier +hi def link erlangMacro Macro +hi def link erlangRecord Structure +hi def link erlangQuotedRecord Structure +hi def link erlangMap Structure endif +" Bitstrings +if !s:old_style +hi def link erlangBitType Type +endif + +" Constants and Directives +if s:old_style +hi def link erlangAttribute Type +hi def link erlangMacroDef Type +hi def link erlangUnknownAttribute Normal +hi def link erlangInclude Type +hi def link erlangRecordDef Type +hi def link erlangDefine Type +hi def link erlangPreCondit Type +hi def link erlangType Type +else +hi def link erlangAttribute Keyword +hi def link erlangMacroDef Macro +hi def link erlangUnknownAttribute Normal +hi def link erlangInclude Include +hi def link erlangRecordDef Keyword +hi def link erlangDefine Define +hi def link erlangPreCondit PreCondit +hi def link erlangType Type +endif + +" Keywords +hi def link erlangKeyword Keyword + +" Build-in-functions (BIFs) +hi def link erlangBIF Function + +if s:old_style +hi def link erlangBoolean Statement +hi def link erlangExtra Statement +hi def link erlangSignal Statement +else +hi def link erlangBoolean Boolean +hi def link erlangExtra Statement +hi def link erlangSignal Statement +endif + + let b:current_syntax = "erlang" let &cpo = s:cpo_save diff --git a/syntax/haskell.vim b/syntax/haskell.vim index bc86fbe7..e301742b 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -24,14 +24,14 @@ endif syn spell notoplevel syn match haskellRecordField contained containedin=haskellBlock - \ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)" + \ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\_s\+::\s" \ contains= \ haskellIdentifier, \ haskellOperators, \ haskellSeparator, \ haskellParens syn match haskellTypeSig - \ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)" + \ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\_s\+::\s" \ contains= \ haskellWhere, \ haskellLet, @@ -47,7 +47,7 @@ syn match haskellDecl "\<\(type\|data\)\>\s\+\(\\)\?" syn keyword haskellDefault default syn keyword haskellImportKeywords import qualified safe as hiding contained syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained -syn region haskellForeignImport start="\" end="::" keepend +syn region haskellForeignImport start="\" end="\_s\+::\s" keepend \ contains= \ haskellString, \ haskellOperators, diff --git a/syntax/html.vim b/syntax/html.vim index da9117dc..3f58cf02 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -2,8 +2,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1 " Vim syntax file " Language: HTML (version 5.1) -" SVG (SVG 1.1 (Second Edition) ) -" Last Change: 2016 Jan 20 +" SVG (SVG 1.1 Second Edition) +" MathML (MathML 3.0 Second Edition) +" Last Change: 2017 Mar 07 " License: Public domain " (but let me know if you like :) ) " @@ -18,6 +19,15 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1 " Modified: htdebeer " Changes: add common SVG elements and attributes for inline SVG +" Patch 7.4.1142 +if has("patch-7.4-1142") + if has("win32") + syn iskeyword @,48-57,_,128-167,224-235,- + else + syn iskeyword @,48-57,_,192-255,- + endif +endif + " HTML 5 tags syn keyword htmlTagName contained article aside audio canvas command syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer @@ -90,7 +100,7 @@ syn keyword htmlArg contained xml:lang xml:space xml:base xmlns syn keyword htmlArg contained onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload syn keyword htmlArg contained onmessage onoffline ononline onpopstate onredo onresize onstorage onundo onunload "