From 3c56c1c7cd051cc7ac7cea0ad66748d8afe1a3cb Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 17 Dec 2015 10:44:58 +0100 Subject: [PATCH] Update --- README.md | 2 +- after/syntax/cpp.vim | 29 +++++++++++++++-- autoload/dart.vim | 70 ++++++++++++++++++++++++++++++++++++++++++ compiler/exunit.vim | 10 ++++-- compiler/rspec.vim | 1 + ftplugin/git.vim | 1 + ftplugin/gitcommit.vim | 2 +- indent/gitconfig.vim | 2 +- syntax/dart.vim | 2 +- syntax/elixir.vim | 10 +++--- syntax/gitcommit.vim | 2 +- syntax/gitrebase.vim | 3 +- syntax/kotlin.vim | 4 +-- syntax/perl.vim | 30 +++++++++--------- 14 files changed, 136 insertions(+), 32 deletions(-) create mode 100644 autoload/dart.vim diff --git a/README.md b/README.md index 653a2fb..b09bd51 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo - [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [css](https://github.com/JulesWang/css.vim) (syntax) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect) -- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, ftplugin, ftdetect) +- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect) - [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect) diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim index 6eb3cfa..f6c866a 100644 --- a/after/syntax/cpp.vim +++ b/after/syntax/cpp.vim @@ -65,7 +65,7 @@ syn cluster cppSTLgroup contains=cppSTLfunction,cppSTLfunctional,cppSTLconst " ----------------------------------------------------------------------------- " Standard library types and functions. " -" Mainly based on the excellent STL Syntax vim script by +" Mainly based on the excellent STL Syntax vim script by " Mizuchi " http://www.vim.org/scripts/script.php?script_id=4293 " which in turn is based on the scripts @@ -1324,6 +1324,31 @@ if !exists("cpp_no_cpp14") "dynarray syntax keyword cppSTLtype dynarray + "helper type traits types + syntax keyword cppSTLtype remove_cv_t + syntax keyword cppSTLtype remove_const_t + syntax keyword cppSTLtype remove_volatile_t + syntax keyword cppSTLtype add_cv_t + syntax keyword cppSTLtype add_const_t + syntax keyword cppSTLtype add_volatile_t + syntax keyword cppSTLtype remove_reference_t + syntax keyword cppSTLtype add_lvalue_reference_t + syntax keyword cppSTLtype add_rvalue_reference_t + syntax keyword cppSTLtype remove_pointer_t + syntax keyword cppSTLtype add_pointer_t + syntax keyword cppSTLtype remove_extent_t + syntax keyword cppSTLtype remove_all_extents_t + syntax keyword cppSTLtype make_signed_t + syntax keyword cppSTLtype make_unsigned_t + syntax keyword cppSTLtype aligned_storage_t + syntax keyword cppSTLtype aligned_union_t + syntax keyword cppSTLtype decay_t + syntax keyword cppSTLtype enable_if_t + syntax keyword cppSTLtype conditional_t + syntax keyword cppSTLtype common_type_t + syntax keyword cppSTLtype underlying_type_t + syntax keyword cppSTLtype result_of_t + "thread syntax keyword cppSTLtype shared_mutex syntax keyword cppSTLtype shared_lock @@ -1362,7 +1387,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits") HiLink cppSTLenum Typedef HiLink cppSTLios Function HiLink cppSTLcast Statement " be consistent with official syntax - HiLink cppRawString String + HiLink cppRawString String HiLink cppRawDelimiter Delimiter delcommand HiLink endif diff --git a/autoload/dart.vim b/autoload/dart.vim new file mode 100644 index 0000000..6538092 --- /dev/null +++ b/autoload/dart.vim @@ -0,0 +1,70 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1 + + +function! s:error(text) abort + echohl Error + echomsg printf('[dart-vim-plugin] %s', a:text) + echohl None +endfunction + +function! s:cexpr(errorformat, joined_lines) abort + let temp_errorfomat = &errorformat + try + let &errorformat = a:errorformat + cexpr a:joined_lines + copen + finally + let &errorformat = temp_errorfomat + endtry +endfunction + +function! dart#fmt(q_args) abort + if executable('dartfmt') + let path = expand('%:p:gs:\:/:') + if filereadable(path) + let joined_lines = system(printf('dartfmt %s %s', a:q_args, shellescape(path))) + if 0 == v:shell_error + silent % delete _ + silent put=joined_lines + silent 1 delete _ + else + call s:cexpr('line %l\, column %c of %f: %m', joined_lines) + endif + else + call s:error(printf('cannot read a file: "%s"', path)) + endif + else + call s:error('cannot execute binary file: dartfmt') + endif +endfunction + +function! dart#analyzer(q_args) abort + if executable('dartanalyzer') + let path = expand('%:p:gs:\:/:') + if filereadable(path) + let joined_lines = system(printf('dartanalyzer %s %s', a:q_args, shellescape(path))) + call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines) + else + call s:error(printf('cannot read a file: "%s"', path)) + endif + else + call s:error('cannot execute binary file: dartanalyzer') + endif +endfunction + +function! dart#tojs(q_args) abort + if executable('dart2js') + let path = expand('%:p:gs:\:/:') + if filereadable(path) + let joined_lines = system(printf('dart2js %s %s', a:q_args, shellescape(path))) + call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines) + else + call s:error(printf('cannot read a file: "%s"', path)) + endif + else + call s:error('cannot execute binary file: dartanalyzer') + endif +endfunction + + +endif diff --git a/compiler/exunit.vim b/compiler/exunit.vim index dfb0ea3..9fc921a 100644 --- a/compiler/exunit.vim +++ b/compiler/exunit.vim @@ -16,9 +16,15 @@ endif let s:cpo_save = &cpo set cpo-=C - CompilerSet makeprg=mix\ test -CompilerSet errorformat=%A\ \ %.)\ %m(%.%#),%C\ \ \ \ \ **%m,%C\ \ \ \ \ \ \ %m,%Z\ \ \ \ \ at\ %f:%l,%-G%.%# +CompilerSet errorformat= + \%E\ \ %n)\ %m, + \%+G\ \ \ \ \ **\ %m, + \%+G\ \ \ \ \ stacktrace:, + \%C\ \ \ \ \ %f:%l, + \%+G\ \ \ \ \ \ \ (%\\w%\\+)\ %f:%l:\ %m, + \%+G\ \ \ \ \ \ \ %f:%l:\ %.%#, + \**\ (%\\w%\\+)\ %f:%l:\ %m let &cpo = s:cpo_save unlet s:cpo_save diff --git a/compiler/rspec.vim b/compiler/rspec.vim index 342b2a7..8c5a5fe 100644 --- a/compiler/rspec.vim +++ b/compiler/rspec.vim @@ -27,6 +27,7 @@ CompilerSet errorformat= \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#, \%E\ \ %\\d%\\+)%.%#, \%C\ \ \ \ \ %m, + \%C%\\s%#, \%-G%.%# let &cpo = s:cpo_save diff --git a/ftplugin/git.vim b/ftplugin/git.vim index 853dfa1..444d756 100644 --- a/ftplugin/git.vim +++ b/ftplugin/git.vim @@ -3,6 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 " Vim filetype plugin " Language: generic git output " Maintainer: Tim Pope +" Last Change: 2013 May 30 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) diff --git a/ftplugin/gitcommit.vim b/ftplugin/gitcommit.vim index b031ef7..82602a1 100644 --- a/ftplugin/gitcommit.vim +++ b/ftplugin/gitcommit.vim @@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 " Vim filetype plugin " Language: git commit file " Maintainer: Tim Pope -" Last Change: 2012 April 7 +" Last Change: 2013 May 30 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) diff --git a/indent/gitconfig.vim b/indent/gitconfig.vim index b6453d2..6fc4ba3 100644 --- a/indent/gitconfig.vim +++ b/indent/gitconfig.vim @@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 " Vim indent file " Language: git config file " Maintainer: Tim Pope -" Last Change: 2012 April 7 +" Last Change: 2013 May 30 if exists("b:did_indent") finish diff --git a/syntax/dart.vim b/syntax/dart.vim index ebfb7ab..e66829a 100644 --- a/syntax/dart.vim +++ b/syntax/dart.vim @@ -46,7 +46,7 @@ syntax keyword dartTodo contained TODO FIXME XXX syntax region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLink,@Spell syntax match dartLineComment "//.*" contains=dartTodo,@Spell syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell -syntax region dartDocLink contained start=+\[+ end=+\]+ +syntax region dartDocLink oneline contained start=+\[+ end=+\]+ " Strings syntax region dartString start=+\z(["']\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar diff --git a/syntax/elixir.vim b/syntax/elixir.vim index f2c5829..b75340b 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -14,12 +14,12 @@ syn sync minlines=2000 syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments -syn match elixirComment '#.*' contains=elixirTodo +syn match elixirComment '#.*' contains=elixirTodo,@Spell syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained -syn keyword elixirKeyword case when cond for if unless try receive spawn send +syn keyword elixirKeyword case when cond for if unless try receive send syn keyword elixirKeyword exit raise throw after rescue catch else do end -syn keyword elixirKeyword quote unquote super +syn keyword elixirKeyword quote unquote super spawn spawn_link spawn_monitor " Functions used on guards syn keyword elixirKeyword contained is_atom is_binary is_bitstring is_boolean @@ -87,8 +87,8 @@ syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{ syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop -syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation fold keepend -syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation fold keepend +syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation,@Spell fold keepend +syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation,@Spell fold keepend syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString syn match elixirString "\(\w\)\@\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)" diff --git a/syntax/gitcommit.vim b/syntax/gitcommit.vim index 88dc19e..74477b2 100644 --- a/syntax/gitcommit.vim +++ b/syntax/gitcommit.vim @@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 " Language: git commit file " Maintainer: Tim Pope " Filenames: *.git/COMMIT_EDITMSG -" Last Change: 2012 April 7 +" Last Change: 2013 May 30 if exists("b:current_syntax") finish diff --git a/syntax/gitrebase.vim b/syntax/gitrebase.vim index 025c9a3..54bd398 100644 --- a/syntax/gitrebase.vim +++ b/syntax/gitrebase.vim @@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 " Language: git rebase --interactive " Maintainer: Tim Pope " Filenames: git-rebase-todo -" Last Change: 2015 November 21 +" Last Change: 2013 May 30 if exists("b:current_syntax") finish @@ -34,6 +34,7 @@ hi def link gitrebaseEdit PreProc hi def link gitrebaseSquash Type hi def link gitrebaseFixup Special hi def link gitrebaseExec Function +hi def link gitrebaseDrop Comment hi def link gitrebaseSummary String hi def link gitrebaseComment Comment hi def link gitrebaseSquashError Error diff --git a/syntax/kotlin.vim b/syntax/kotlin.vim index e3d3f07..e882841 100644 --- a/syntax/kotlin.vim +++ b/syntax/kotlin.vim @@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1 " Vim syntax file " Language: Kotlin " Maintainer: Alexander Udalov -" Latest Revision: 1 October 2015 +" Latest Revision: 7 December 2015 if exists("b:current_syntax") finish @@ -15,7 +15,7 @@ syn keyword ktStatement break continue return syn keyword ktConditional if else when syn keyword ktRepeat do for while syn keyword ktOperator as in is by -syn keyword ktKeyword get set out super this This where +syn keyword ktKeyword get set out super this where syn keyword ktException try catch finally throw syn keyword ktInclude import package diff --git a/syntax/perl.vim b/syntax/perl.vim index 6e6e6ef..d831fb0 100644 --- a/syntax/perl.vim +++ b/syntax/perl.vim @@ -244,18 +244,18 @@ syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesD " Simple version of searches and matches -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend +syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@\)\@\)\@\)\@[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend +syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@\)\@+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@\)\@[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend -syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend +syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend +syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend " Translations " perlMatch is the first part, perlTranslation* is the second, translator part.