From 1f34e0adcfb54b45760d7570d4c270a939daa03b Mon Sep 17 00:00:00 2001 From: Dan Reif Date: Tue, 5 Jun 2018 13:50:18 -0700 Subject: [PATCH] Update (periodic rebuild) --- autoload/xml/html5.vim | 4 +- compiler/credo.vim | 15 ++++++ compiler/mix.vim | 15 ++++++ compiler/nim.vim | 2 +- extras/flow.vim | 2 +- ftplugin/elm.vim | 16 +++---- ftplugin/graphql.vim | 3 ++ ftplugin/ruby.vim | 4 +- ftplugin/twig.vim | 21 ++++++++ indent/haskell.vim | 95 ++++++++++++++++++------------------- syntax/carp.vim | 2 +- syntax/cmake.vim | 9 ++-- syntax/elixir.vim | 2 +- syntax/elm.vim | 18 +++++-- syntax/erlang.vim | 3 ++ syntax/git.vim | 2 + syntax/go.vim | 2 +- syntax/html.vim | 2 + syntax/javascript.vim | 7 +-- syntax/javascript/html5.vim | 5 +- syntax/ruby.vim | 2 +- syntax/vue.vim | 2 +- 22 files changed, 154 insertions(+), 79 deletions(-) create mode 100644 compiler/credo.vim create mode 100644 compiler/mix.vim diff --git a/autoload/xml/html5.vim b/autoload/xml/html5.vim index 5a474ac..11be730 100644 --- a/autoload/xml/html5.vim +++ b/autoload/xml/html5.vim @@ -191,7 +191,7 @@ let attributes_value = { \ } if g:html5_event_handler_attributes_complete == 1 - let event_handler_attributes = {'onabort': [], 'onblur': [], 'oncanplay': [], 'oncanplaythrough': [], 'onchange': [], 'onclick': [], 'oncontextmenu': [], 'ondblclick': [], 'ondrag': [], 'ondragend': [], 'ondragenter': [], 'ondragleave': [], 'ondragover': [], 'ondragstart': [], 'ondrop': [], 'ondurationchange': [], 'onemptied': [], 'onended': [], 'onerror': [], 'onfocus': [], 'onformchange': [], 'onforminput': [], 'oninput': [], 'oninvalid': [], 'onkeydown': [], 'onkeypress': [], 'onkeyup': [], 'onload': [], 'onloadeddata': [], 'onloadedmetadata': [], 'onloadstart': [], 'onmousedown': [], 'onmousemove': [], 'onmouseout': [], 'onmouseover': [], 'onmouseup': [], 'onmousewheel': [], 'onpause': [], 'onplay': [], 'onplaying': [], 'onprogress': [], 'onratechange': [], 'onreadystatechange': [], 'onscroll': [], 'onseeked': [], 'onseeking': [], 'onselect': [], 'onshow': [], 'onstalled': [], 'onsubmit': [], 'onsuspend': [], 'ontimeupdate': [], 'onvolumechange': [], 'onwaiting': []} + let event_handler_attributes = {'onabort': [], 'onblur': [], 'oncanplay': [], 'oncanplaythrough': [], 'onchange': [], 'onclick': [], 'oncontextmenu': [], 'ondblclick': [], 'ondrag': [], 'ondragend': [], 'ondragenter': [], 'ondragleave': [], 'ondragover': [], 'ondragstart': [], 'ondrop': [], 'ondurationchange': [], 'onemptied': [], 'onended': [], 'onerror': [], 'onfocus': [], 'onformchange': [], 'onforminput': [], 'oninput': [], 'oninvalid': [], 'onkeydown': [], 'onkeypress': [], 'onkeyup': [], 'onload': [], 'onloadeddata': [], 'onloadedmetadata': [], 'onloadstart': [], 'onmousedown': [], 'onmousemove': [], 'onmouseout': [], 'onmouseover': [], 'onmouseup': [], 'onmousewheel': [], 'onpause': [], 'onplay': [], 'onplaying': [], 'onprogress': [], 'onratechange': [], 'onreadystatechange': [], 'onscroll': [], 'onseeked': [], 'onseeking': [], 'onselect': [], 'onshow': [], 'onstalled': [], 'onsubmit': [], 'onsuspend': [], 'ontimeupdate': [], 'onvolumechange': [], 'onwaiting': [], 'onselectstart': [], 'onselectchange': []} let global_attributes = extend(global_attributes, event_handler_attributes) let body_attributes = {'onafterprint': [], 'onbeforeprint': [], 'onbeforeunload': [], 'onblur': [], 'onerror': [], 'onfocus': [], 'onhashchange': [], 'onload': [], 'onmessage': [], 'onoffline': [], 'ononline': [], 'onpopstate': [], 'onredo': [], 'onresize': [], 'onstorage': [], 'onundo': [], 'onunload': []} @@ -214,6 +214,8 @@ if g:html5_event_handler_attributes_complete == 1 \ 'ondragleave': ['Script', ''], \ 'ondragover': ['Script', ''], \ 'ondragstart': ['Script', ''], + \ 'onselectstart': ['Script', ''], + \ 'onselectchange': ['Script', ''], \ 'ondrop': ['Script', ''], \ 'ondurationchange': ['Script', ''], \ 'onemptied': ['Script', ''], diff --git a/compiler/credo.vim b/compiler/credo.vim new file mode 100644 index 0000000..e656a23 --- /dev/null +++ b/compiler/credo.vim @@ -0,0 +1,15 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1 + +if exists('current_compiler') + finish +endif +let current_compiler = 'credo' + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet errorformat=%f:%l:\ %t:\ %m +CompilerSet makeprg=mix\ credo\ suggest\ --format=flycheck + +endif diff --git a/compiler/mix.vim b/compiler/mix.vim new file mode 100644 index 0000000..ec88dd5 --- /dev/null +++ b/compiler/mix.vim @@ -0,0 +1,15 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1 + +if exists('current_compiler') + finish +endif +let current_compiler = 'mix' + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet errorformat=%A%t%*[^:]:\ %m,%C%f:%l:\ %m,%C%f:%l,%Z +CompilerSet makeprg=mix + +endif diff --git a/compiler/nim.vim b/compiler/nim.vim index c47dad0..4b1bd0e 100644 --- a/compiler/nim.vim +++ b/compiler/nim.vim @@ -13,7 +13,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=nim\ c\ --verbosity:0\ $*\ %:p +CompilerSet makeprg=nim\ c\ --verbosity:0\ --listfullpaths\ $*\ %:p CompilerSet errorformat= \%-GHint:\ %m, diff --git a/extras/flow.vim b/extras/flow.vim index d029db8..b3f899d 100644 --- a/extras/flow.vim +++ b/extras/flow.vim @@ -33,7 +33,7 @@ syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=/ syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=// contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock syntax region jsFlowClassFunctionGroup contained matchgroup=jsFlowNoise start=// contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs -syntax region jsFlowTypeStatement start=/type\%(\s\+\k\)\@=/ end=/=\@=/ contains=jsFlowTypeOperator oneline skipwhite skipempty nextgroup=jsFlowTypeValue keepend +syntax region jsFlowTypeStatement start=/\(opaque\s\+\)\?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 syntax match jsFlowTypeOperator contained /=/ containedin=jsFlowTypeValue syntax match jsFlowTypeOperator contained /=/ diff --git a/ftplugin/elm.vim b/ftplugin/elm.vim index 180e719..c989d92 100644 --- a/ftplugin/elm.vim +++ b/ftplugin/elm.vim @@ -43,14 +43,14 @@ setlocal comments=:-- setlocal commentstring=--\ %s " Commands -command -buffer -nargs=? -complete=file ElmMake call elm#Make() -command -buffer ElmMakeMain call elm#Make("Main.elm") -command -buffer -nargs=? -complete=file ElmTest call elm#Test() -command -buffer ElmRepl call elm#Repl() -command -buffer ElmErrorDetail call elm#ErrorDetail() -command -buffer ElmShowDocs call elm#ShowDocs() -command -buffer ElmBrowseDocs call elm#BrowseDocs() -command -buffer ElmFormat call elm#Format() +command! -buffer -nargs=? -complete=file ElmMake call elm#Make() +command! -buffer ElmMakeMain call elm#Make("Main.elm") +command! -buffer -nargs=? -complete=file ElmTest call elm#Test() +command! -buffer ElmRepl call elm#Repl() +command! -buffer ElmErrorDetail call elm#ErrorDetail() +command! -buffer ElmShowDocs call elm#ShowDocs() +command! -buffer ElmBrowseDocs call elm#BrowseDocs() +command! -buffer ElmFormat call elm#Format() if get(g:, 'elm_setup_keybindings', 1) nmap m (elm-make) diff --git a/ftplugin/graphql.vim b/ftplugin/graphql.vim index 42d96e6..d1ac432 100644 --- a/ftplugin/graphql.vim +++ b/ftplugin/graphql.vim @@ -13,5 +13,8 @@ setlocal comments=:# setlocal commentstring=#\ %s setlocal formatoptions-=t setlocal iskeyword+=$,@-@ +setlocal softtabstop=2 +setlocal shiftwidth=2 +setlocal expandtab endif diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index 9189730..b844bfd 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -46,7 +46,7 @@ endif setlocal formatoptions-=t formatoptions+=croql setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\) -setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\%(\.rb\)\=$','.rb','') +setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\\%(\\.rb\\)\\=$','.rb','') setlocal suffixesadd=.rb if exists("&ofu") && has("ruby") @@ -151,7 +151,7 @@ let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<" function! s:map(mode, flags, map) abort let from = matchstr(a:map, '\S\+') if empty(mapcheck(from, a:mode)) - exe a:mode.'map' ''.(a:0 ? a:1 : '') a:map + exe a:mode.'map' '' a:map let b:undo_ftplugin .= '|sil! '.a:mode.'unmap '.from endif endfunction diff --git a/ftplugin/twig.vim b/ftplugin/twig.vim index 8fa94a4..fc406db 100644 --- a/ftplugin/twig.vim +++ b/ftplugin/twig.vim @@ -12,6 +12,27 @@ setlocal comments=s:{#,ex:#} setlocal formatoptions+=tcqln " setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+ +if exists('b:match_words') + let b:twigMatchWords = [ + \ ['block', 'endblock'], + \ ['for', 'endfor'], + \ ['macro', 'endmacro'], + \ ['if', 'elseif', 'else', 'endif'], + \ ['set', 'endset'] + \] + for s:element in b:twigMatchWords + let s:pattern = '' + for s:tag in s:element[:-2] + if s:pattern != '' + let s:pattern .= ':' + endif + let s:pattern .= '{%\s*\<' . s:tag . '\>\s*\%(.*=\)\@![^}]\{-}%}' + endfor + let s:pattern .= ':{%\s*\<' . s:element[-1:][0] . '\>\s*.\{-}%}' + let b:match_words .= ',' . s:pattern + endfor +endif + if exists("b:did_ftplugin") let b:undo_ftplugin .= "|setlocal comments< formatoptions<" else diff --git a/indent/haskell.vim b/indent/haskell.vim index 11cca26..df74f33 100644 --- a/indent/haskell.vim +++ b/indent/haskell.vim @@ -42,12 +42,6 @@ if !exists('g:haskell_indent_let') let g:haskell_indent_let = 4 endif -if !exists('g:haskell_indent_let_no_in') - " let x = 0 - " x - let g:haskell_indent_let_no_in = 4 -endif - if !exists('g:haskell_indent_where') " where f :: Int -> Int " >>>>>>f x = x @@ -73,7 +67,7 @@ if !exists('g:haskell_indent_guard') endif setlocal indentexpr=GetHaskellIndent() -setlocal indentkeys=0},0),0],!^F,o,O,0=where,0=let,0=deriving, +setlocal indentkeys=!^F,o,O,0{,0},0(,0),0[,0],0,,0=where,0=let,0=deriving,0=in\ ,0=::\ ,0=\-\>\ ,0=\=\>\ ,0=\|\ ,=\=\ function! s:isInBlock(hlstack) return index(a:hlstack, 'haskellDelimiter') > -1 || index(a:hlstack, 'haskellParens') > -1 || index(a:hlstack, 'haskellBrackets') > -1 || index(a:hlstack, 'haskellBlock') > -1 || index(a:hlstack, 'haskellBlockComment') > -1 || index(a:hlstack, 'haskellPragma') > -1 @@ -115,25 +109,26 @@ endfunction " backtrack to find guard clause function! s:indentGuard(pos, prevline) let l:l = a:prevline - let l:c = 1 + let l:c = v:lnum - 1 + let l:s = indent(l:c) - while v:lnum != l:c - " empty line, stop looking - if l:l =~ '^$' - return a:pos - " guard found - elseif l:l =~ '^\s*|\s\+' - return match(l:l, '|') - " found less deeper indentation (not starting with `,` or `=`) - " stop looking + while l:c >= 1 + if l:s == 0 && strlen(l:l) > 0 + " top-level start, stop looking + return g:haskell_indent_guard + elseif l:l =~ '^\s\+[|,=]\s\+' + " guard block found + return match(l:l, '[|,=]') else - let l:m = match(l:l, '\S') - if l:l !~ '^\s*[=,]' && l:m <= a:pos - return l:m + g:haskell_indent_guard + if l:s > 0 && l:s <= a:pos + " found less deeper indentation (not starting with `,` or `=`) + " stop looking + return l:s + g:haskell_indent_guard endif endif - let l:c += 1 - let l:l = getline(v:lnum - l:c) + let l:c -= 1 + let l:l = getline(l:c) + let l:s = indent(l:c) endwhile return -1 @@ -196,7 +191,7 @@ function! GetHaskellIndent() " operator at end of previous line if l:prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$' - return match(l:prevline, '\S') + &shiftwidth + return indent(v:lnum - 1) + &shiftwidth endif " let foo = @@ -207,7 +202,7 @@ function! GetHaskellIndent() " let x = 1 in " >>>>x - if l:prevline =~ '\C\\s\+.\+\\?$' && l:line !~ '\C^\s*\' + if l:prevline =~ '\C\.\{-}\\s*$' && l:line !~ '\C^\s*\' return match(l:prevline, '\C\') + g:haskell_indent_let endif @@ -215,9 +210,6 @@ function! GetHaskellIndent() " let y = 2 " " let x = 1 - " >in x - " - " let x = 1 " >>>>y = 2 " " let x = 1 @@ -228,21 +220,11 @@ function! GetHaskellIndent() if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) return l:s endif - elseif l:line =~ '\C^\s*\' - let l:s = match(l:prevline, '\C\') - if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) - return l:s + g:haskell_indent_in - endif elseif l:line =~ '\s=\s' let l:s = match(l:prevline, '\C\') if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) return l:s + g:haskell_indent_let endif - else - let l:s = match(l:prevline, '\C\') - if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) - return l:s + g:haskell_indent_let_no_in - endif endif endif @@ -263,7 +245,7 @@ function! GetHaskellIndent() " >>foo " if l:prevline =~ '\C\\s*$' - return match(l:prevline, '\S') + get(g:, 'haskell_indent_after_bare_where', &shiftwidth) + return indent(v:lnum - 1) + get(g:, 'haskell_indent_after_bare_where', &shiftwidth) endif " do @@ -272,7 +254,7 @@ function! GetHaskellIndent() " foo = " >>bar if l:prevline =~ '\C\(\\|=\)\s*$' - return match(l:prevline, '\S') + &shiftwidth + return indent(v:lnum - 1) + &shiftwidth endif " do foo @@ -288,7 +270,7 @@ function! GetHaskellIndent() " >>bar -> quux if l:prevline =~ '\C\.\+\\s*$' if get(g:,'haskell_indent_case_alternative', 0) - return match(l:prevline, '\S') + &shiftwidth + return indent(v:lnum - 1) + &shiftwidth else return match(l:prevline, '\C\') + g:haskell_indent_case endif @@ -321,7 +303,7 @@ function! GetHaskellIndent() " newtype Foo = Foo " >>deriving if l:prevline =~ '\C^\s*\<\(newtype\|data\)\>[^{]\+' && l:line =~ '\C^\s*\' - return match(l:prevline, '\S') + &shiftwidth + return indent(v:lnum - 1) + &shiftwidth endif " foo :: Int @@ -363,9 +345,9 @@ function! GetHaskellIndent() else let l:m = matchstr(l:line, '^\s*\zs\<\S\+\>\ze') let l:l = l:prevline - let l:c = 1 + let l:c = v:lnum - 1 - while v:lnum != l:c + while l:c >= 1 " fun decl if l:l =~ ('^\s*' . l:m . '\(\s*::\|\n\s\+::\)') let l:s = match(l:l, l:m) @@ -378,8 +360,8 @@ function! GetHaskellIndent() elseif l:l =~ '^$' return 0 endif - let l:c += 1 - let l:l = getline(v:lnum - l:c) + let l:c -= 1 + let l:l = getline(l:c) endwhile return 0 @@ -425,8 +407,8 @@ function! GetHaskellIndent() " foo " >>{ - if l:line =~ '^\s*{ ' - let l:s = match(l:prevline, '\S') + if l:line =~ '^\s*{' + let l:s = indent(v:lnum - 1) if l:s >= 0 return l:s + &shiftwidth endif @@ -444,14 +426,27 @@ function! GetHaskellIndent() return match(l:prevline, 'in') - g:haskell_indent_in endif - return match(l:prevline, '\S') + get(g:, 'haskell_indent_before_where', &shiftwidth) + return indent(v:lnum - 1) + get(g:, 'haskell_indent_before_where', &shiftwidth) endif " let x = 1 " y = 2 " >in x + 1 if l:line =~ '\C^\s*\' - return match(l:prevline, '\S') - (4 - g:haskell_indent_in) + let l:s = 0 + let l:c = v:lnum - 1 + + while l:s <= 0 && l:c >= 1 + let l:l = getline(l:c) + let l:s = match(l:l, '\C\') + if l:s >= 1 && s:isSYN('haskellLet', l:c, l:s + 1) + break + elseif l:l =~ '^\S' + return -1 + endif + let l:c -= 1 + endwhile + return l:s + g:haskell_indent_in endif " data Foo @@ -496,7 +491,7 @@ function! GetHaskellIndent() " foo " >>:: Int if l:line =~ '^\s*::\s' - return match(l:prevline, '\S') + &shiftwidth + return indent(v:lnum - 1) + &shiftwidth endif " indent closing brace, paren or bracket diff --git a/syntax/carp.vim b/syntax/carp.vim index 9896f73..a3a86ad 100644 --- a/syntax/carp.vim +++ b/syntax/carp.vim @@ -34,7 +34,7 @@ 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 random -syn keyword carpFunc random-between str mask delete append count duplicate +syn keyword carpFunc random-between str mask delete append length duplicate syn keyword carpFunc cstr chars from-chars to-int from-int sin cos sqrt acos 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 diff --git a/syntax/cmake.vim b/syntax/cmake.vim index cc4a10d..348222c 100644 --- a/syntax/cmake.vim +++ b/syntax/cmake.vim @@ -21,8 +21,10 @@ endif let s:keepcpo= &cpo set cpo&vim -syn region cmakeComment start="#" end="$" contains=cmakeTodo,cmakeLuaComment,@Spell -syn region cmakeLuaComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell +syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell + +syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell +syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped @@ -358,6 +360,8 @@ syn keyword cmakeTodo \ TODO FIXME XXX \ contained +hi def link cmakeBracketArgument String +hi def link cmakeBracketComment Comment hi def link cmakeCommand Function hi def link cmakeCommandConditional Conditional hi def link cmakeCommandDeprecated WarningMsg @@ -367,7 +371,6 @@ hi def link cmakeEnvironment Special hi def link cmakeEscaped Special hi def link cmakeGeneratorExpression WarningMsg hi def link cmakeGeneratorExpressions Constant -hi def link cmakeLuaComment Comment hi def link cmakeModule Include hi def link cmakeProperty Constant hi def link cmakeRegistry Underlined diff --git a/syntax/elixir.vim b/syntax/elixir.vim index 2ed25a5..6a4a30c 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -20,7 +20,7 @@ syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable -syn match elixirKeyword '\(\.\)\@' +syn match elixirKeyword '\(\.\)\@:\@!' syn keyword elixirInclude import require alias use diff --git a/syntax/elm.vim b/syntax/elm.vim index fb3874c..a26fb0f 100644 --- a/syntax/elm.vim +++ b/syntax/elm.vim @@ -7,13 +7,13 @@ if exists('b:current_syntax') endif " Keywords -syn keyword elmConditional case else if of then +syn keyword elmConditional else if of then syn keyword elmAlias alias -syn keyword elmTypedef type port let in +syn keyword elmTypedef contained type port syn keyword elmImport exposing as import module where " Operators -syn match elmOperator "\([-!#$%`&\*\+./<=>\?@\\^|~:]\|\<_\>\)" +syn match elmOperator contained "\([-!#$%`&\*\+./<=>\?@\\^|~:]\|\<_\>\)" " Types syn match elmType "\<[A-Z][0-9A-Za-z_'-]*" @@ -29,7 +29,7 @@ syn match elmTupleFunction "\((,\+)\)" " Comments syn keyword elmTodo TODO FIXME XXX contained syn match elmLineComment "--.*" contains=elmTodo,@spell -syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell +syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell fold " Strings syn match elmStringEscape "\\u[0-9a-fA-F]\{4}" contained @@ -45,6 +45,16 @@ syn match elmFloat "\(\<\d\+\.\d\+\>\)" " Identifiers syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\s\+" contains=elmOperator +" Folding +syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold +syn region elmTopLevelFunction start="^[a-zA-Z].\+\n[a-zA-Z].\+=" end="^\(\n\+\)\@=" contains=ALL fold +syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\n\z1\@!\(\n\n\)\@=" contains=ALL fold +syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold +syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\" end="\" contains=ALL fold + +hi def link elmCaseBlockDefinition Conditional +hi def link elmCaseBlockItemDefinition Conditional +hi def link elmLetBlockDefinition TypeDef hi def link elmTopLevelDecl Function hi def link elmTupleFunction Normal hi def link elmTodo Todo diff --git a/syntax/erlang.vim b/syntax/erlang.vim index c6794a0..11db9c5 100644 --- a/syntax/erlang.vim +++ b/syntax/erlang.vim @@ -81,6 +81,7 @@ syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\ syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*' syn match erlangMacro '??\=[[:alnum:]_@]\+' syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+' +syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier syn match erlangMap '#' syn match erlangRecord '#\s*\l[[:alnum:]_@]*' syn region erlangQuotedRecord start=/#\s*'/ end=/'/ contains=erlangQuotedAtomModifier @@ -193,6 +194,7 @@ hi def link erlangGlobalFuncCall Function hi def link erlangGlobalFuncRef Function hi def link erlangVariable Normal hi def link erlangMacro Normal +hi def link erlangQuotedMacro Normal hi def link erlangRecord Normal hi def link erlangQuotedRecord Normal hi def link erlangMap Normal @@ -204,6 +206,7 @@ hi def link erlangGlobalFuncCall Normal hi def link erlangGlobalFuncRef Normal hi def link erlangVariable Identifier hi def link erlangMacro Macro +hi def link erlangQuotedMacro Macro hi def link erlangRecord Structure hi def link erlangQuotedRecord Structure hi def link erlangMap Structure diff --git a/syntax/git.vim b/syntax/git.vim index 53f44d3..022c1dc 100644 --- a/syntax/git.vim +++ b/syntax/git.vim @@ -27,7 +27,9 @@ syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge +syn match gitDiffAdded "{+.*+}" contained containedin=gitDiff syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge +syn match gitDiffRemoved "\[-.*-\]" contained containedin=gitDiff syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite diff --git a/syntax/go.vim b/syntax/go.vim index c02ad50..ab5ac8a 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -357,7 +357,7 @@ if go#config#HighlightBuildConstraints() || go#config#FoldEnable('package_commen \ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7' \ . ' contains=@goCommentGroup,@Spell' \ . (go#config#FoldEnable('package_comment') ? ' fold' : '') - exe 'syn region goPackageComment start=/\v\/\*.*\n(.*\n)*\s*\*\/\npackage/' + exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/' \ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7' \ . ' contains=@goCommentGroup,@Spell' \ . (go#config#FoldEnable('package_comment') ? ' fold' : '') diff --git a/syntax/html.vim b/syntax/html.vim index 4b02bc7..ee2323d 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -129,6 +129,8 @@ syn keyword htmlArg contained prefetch " syn keyword htmlArg contained preload " syn keyword htmlArg contained decoding +" https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers +syn keyword htmlArg contained onselectstart onselectionchange " Custom Data Attributes " http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes diff --git a/syntax/javascript.vim b/syntax/javascript.vim index d10f1ef..a4ffaa3 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -35,7 +35,7 @@ syntax match jsParensError /[)}\]]/ " Program Keywords syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef syntax match jsVariableDef contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFlowDefinition -syntax keyword jsOperator delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression +syntax keyword jsOperatorKeyword delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression syntax match jsOperator "[-!|&+<>=%/*~^]" skipwhite skipempty nextgroup=@jsExpression syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression syntax keyword jsBooleanTrue true @@ -86,7 +86,7 @@ syntax match jsObjectMethodType contained /\<[gs]et\ze\s\+\K\k*/ skipwhite sk syntax region jsObjectStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '') -exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite skipempty nextgroup=@jsExpression' +exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite nextgroup=@jsExpression' exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '') exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '') exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '') @@ -232,7 +232,7 @@ if exists("javascript_plugin_flow") runtime extras/flow.vim endif -syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsStatement +syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsStatement syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel " Define the default highlighting. @@ -292,6 +292,7 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsArguments Special HiLink jsError Error HiLink jsParensError Error + HiLink jsOperatorKeyword jsOperator HiLink jsOperator Operator HiLink jsOf Operator HiLink jsStorageClass StorageClass diff --git a/syntax/javascript/html5.vim b/syntax/javascript/html5.vim index f950d6c..3176e22 100644 --- a/syntax/javascript/html5.vim +++ b/syntax/javascript/html5.vim @@ -42,9 +42,12 @@ syn keyword javascriptDomElemFuncs load addTextTrack syn keyword javascriptDomElemAttrs videoWidth videoHeight poster " drag and drop -syn keyword javascriptDomElemAttrs onDragStart onDragEnd onDragEnter onDragLeave onDragOver onDrag onDrop draggable dropzone +syn keyword javascriptDomElemAttrs ondragstart ondragend ondragenter ondragleave ondragover ondrag ondrop draggable dropzone " syn keyword javascriptDomElemAttrs indeterminate +" select https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers +syn keyword javascriptDomElemAttrs onselectstart onselectchange + endif diff --git a/syntax/ruby.vim b/syntax/ruby.vim index e61e5f5..9f26998 100644 --- a/syntax/ruby.vim +++ b/syntax/ruby.vim @@ -310,7 +310,7 @@ endif " eRuby Config {{{1 if exists('main_syntax') && main_syntax == 'eruby' let b:ruby_no_expensive = 1 -end +endif " Module, Class, Method and Alias Declarations {{{1 syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite diff --git a/syntax/vue.vim b/syntax/vue.vim index 7dfefdb..697ca83 100644 --- a/syntax/vue.vim +++ b/syntax/vue.vim @@ -37,7 +37,7 @@ function! s:register_language(language, tag, ...) unlet! b:current_syntax execute 'syntax region vue_' . a:language \ 'keepend' - \ 'start=/<' . a:tag . ' \_[^>]*' . attr . '\_[^>]*>/' + \ 'start=/<' . a:tag . '\>\_[^>]*' . attr . '\_[^>]*>/' \ 'end=""me=s-1' \ 'contains=@' . a:language . ',vueSurroundingTag' \ 'fold'