diff --git a/ftplugin/csv.vim b/ftplugin/csv.vim index 7d15b81..c1a5fa4 100644 --- a/ftplugin/csv.vim +++ b/ftplugin/csv.vim @@ -1609,7 +1609,7 @@ fu! AnalyzeColumn(...) "{{{3 let qty = len(data) let res = {} for item in data - if empty(item) + if empty(item) || item ==# b:delimiter let item = 'NULL' endif if !get(res, item) diff --git a/syntax/dockerfile.vim b/syntax/dockerfile.vim index c3a9c4e..60b395e 100644 --- a/syntax/dockerfile.vim +++ b/syntax/dockerfile.vim @@ -10,7 +10,7 @@ endif syntax case ignore syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/ -syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR)\s/ +syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR|COPY)\s/ highlight link dockerfileKeyword Keyword syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ diff --git a/syntax/perl.vim b/syntax/perl.vim index 75c4d5e..73d647a 100644 --- a/syntax/perl.vim +++ b/syntax/perl.vim @@ -39,11 +39,6 @@ endif let s:cpo_save = &cpo set cpo&vim -if exists('®expengine') - let s:regexpengine=®expengine - set regexpengine=1 -endif - " POD starts with ^= and ends with ^=cut if !exists("perl_include_pod") || perl_include_pod == 1 @@ -360,15 +355,11 @@ syn keyword perlStatementPackage package contained " sub [name] [(prototype)] { " syn match perlSubError "[^[:space:];{#]" contained -if v:version == 701 && !has('patch221') " XXX I hope that's the right one - syn match perlSubAttributes ":" contained -else - syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained - syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ - syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup - syn match perlSubAttributes "" contained nextgroup=perlSubError - syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe -endif +syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained +syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ +syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup +syn match perlSubAttributes "" contained nextgroup=perlSubError +syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9 syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError @@ -583,11 +574,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut" let b:current_syntax = "perl" -if exists('®expengine') - let ®expengine=s:regexpengine - unlet s:regexpengine -endif - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/syntax/perl6.vim b/syntax/perl6.vim index fbb39c8..066d6ca 100644 --- a/syntax/perl6.vim +++ b/syntax/perl6.vim @@ -2245,8 +2245,6 @@ endif " know how to use them reliably) syn sync fromstart -setlocal foldmethod=syntax - let b:current_syntax = "perl6" let &cpo = s:keepcpo diff --git a/syntax/ruby.vim b/syntax/ruby.vim index 7d46a55..a570b14 100644 --- a/syntax/ruby.vim +++ b/syntax/ruby.vim @@ -130,8 +130,8 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][io syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold " Normal String and Shell Command Output -syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold -syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold +syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold +syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold " Generalized Single Quoted String, Symbol and Array of Strings diff --git a/syntax/rust.vim b/syntax/rust.vim index 0c7dcb8..9e663eb 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -24,7 +24,7 @@ syn keyword rustKeyword continue syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty syn keyword rustKeyword for in if impl let -syn keyword rustKeyword loop once proc pub +syn keyword rustKeyword loop once pub syn keyword rustKeyword return super syn keyword rustKeyword unsafe virtual where while syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty @@ -90,7 +90,7 @@ syn keyword rustTrait Clone syn keyword rustTrait PartialEq PartialOrd Eq Ord syn keyword rustEnum Ordering Equiv syn keyword rustEnumVariant Less Equal Greater -syn keyword rustTrait FromIterator Extend ExactSize +syn keyword rustTrait FromIterator Extend ExactSizeIterator syn keyword rustTrait Iterator DoubleEndedIterator syn keyword rustTrait RandomAccessIterator CloneableIterator syn keyword rustTrait OrdIterator MutableDoubleEndedIterator @@ -151,6 +151,7 @@ syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic syn match rustEscapeError display contained /\\./ syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/ +syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/ syn match rustStringContinuation display contained /\\\n\s*/ syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell @@ -187,7 +188,7 @@ syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/ " The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII). syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/ syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode -syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid +syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell diff --git a/syntax/tap.vim b/syntax/tap.vim new file mode 100644 index 0000000..51a5647 --- /dev/null +++ b/syntax/tap.vim @@ -0,0 +1,97 @@ +" Vim syntax file +" Language: Verbose TAP Output +" Maintainer: Rufus Cable +" Remark: Simple syntax highlighting for TAP output +" License: +" Copyright: (c) 2008-2013 Rufus Cable +" Last Change: {{LAST_CHANGE}} + +if exists("b:current_syntax") + finish +endif + +syn match tapTestDiag /^ *#.*/ contains=tapTestTodo +syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile +syn match tapTestFile /\w\+\/[^. ]*/ contained +syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained + +syn match tapTestPlan /^ *\d\+\.\.\d\+$/ + +" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx' +syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine + +" tapTestLine is the line without the ok/not ok status - i.e. number and +" optional message +syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained + +" turn ok/not ok messages green/red respectively +syn match tapTestStatusOK /ok/ contained +syn match tapTestStatusNotOK /not ok/ contained + +" highlight todo tests +syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev +syn match tapTestTodoRev /\/ contained + +" highlight skipped tests +syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag +syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained + +" look behind so "ok 123" and "not ok 124" match test number +syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained +syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot +syn match tapTestThreeStars /\*\*\*/ contained + +syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl +syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/ +syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/ +syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK + +syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained +syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained + +syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/ + +set foldtext=TAPTestLine_foldtext() +function! TAPTestLine_foldtext() + let line = getline(v:foldstart) + let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') + return sub +endfunction + +set foldminlines=5 +set foldcolumn=2 +set foldenable +set foldmethod=syntax +syn sync fromstart + +if !exists("did_tapverboseoutput_syntax_inits") + let did_tapverboseoutput_syntax_inits = 1 + + hi tapTestStatusOK term=bold ctermfg=green guifg=Green + hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red + hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black + hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow + hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue + hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue + hi tapTestTime term=bold ctermfg=blue guifg=Blue + hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow + hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black + hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue + hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow + + hi link tapTestFileWithDot tapTestLoadedFile + hi link tapTestNumber Number + hi link tapTestDiag Comment + + hi tapTestRegion ctermbg=green + + hi tapTestResultsOKRegion ctermbg=green ctermfg=black + hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black + + hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white + hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black + + hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black +endif + +let b:current_syntax="tapVerboseOutput"