From 4071c094c69ba8ef716f8048cac8415fc7d96e26 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 9 Dec 2014 23:09:20 +0100 Subject: Update --- syntax/csv.vim | 29 --------------------- syntax/elixir.vim | 5 +++- syntax/eruby.vim | 2 +- syntax/go.vim | 12 ++++++--- syntax/html.vim | 3 +++ syntax/javascript.vim | 49 ++++++++++++++--------------------- syntax/mustache.vim | 4 +-- syntax/rust.vim | 72 +++++++++++++++++++++++---------------------------- syntax/typescript.vim | 4 +-- 9 files changed, 72 insertions(+), 108 deletions(-) (limited to 'syntax') diff --git a/syntax/csv.vim b/syntax/csv.vim index e2da7dbc..543a9fe9 100644 --- a/syntax/csv.vim +++ b/syntax/csv.vim @@ -139,35 +139,6 @@ fu! DoSyntaxDefinitions() "{{{3 hi def link CSVColumnHeaderEven WarningMsg hi def link CSVColumnOdd DiffAdd hi def link CSVColumnEven DiffChange - " Old Version - if 0 - if &t_Co < 88 - if !exists("b:csv_fixed_width_cols") - hi default CSVColumnHeaderOdd ctermfg=DarkRed ctermbg=15 - \ guibg=grey80 guifg=black term=underline cterm=standout,bold - \ gui=bold,underline - endif - hi default CSVColumnOdd ctermfg=DarkRed ctermbg=15 guibg=grey80 - \ guifg=black term=underline cterm=bold gui=underline - else - if !exists("b:csv_fixed_width_cols") - hi default CSVColumnHeaderOdd ctermfg=darkblue ctermbg=white - \ guibg=grey80 guifg=black cterm=standout,underline - \ gui=bold,underline - endif - hi default CSVColumnOdd ctermfg=darkblue ctermbg=white guibg=grey80 - \ guifg=black cterm=reverse,underline gui=underline - endif - - " ctermbg=8 should be safe, even in 8 color terms - if !exists("b:csv_fixed_width_cols") - hi default CSVColumnHeaderEven ctermfg=white ctermbg=darkgrey - \ guibg=grey50 guifg=black term=bold cterm=standout,underline - \ gui=bold,underline - endif - hi default CSVColumnEven ctermfg=white ctermbg=darkgrey guibg=grey50 - \ guifg=black term=bold cterm=underline gui=bold,underline - endif endfun " Main: {{{2 diff --git a/syntax/elixir.vim b/syntax/elixir.vim index f7035633..c6818f29 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -22,6 +22,8 @@ syn keyword elixirKeyword quote unquote super syn keyword elixirInclude import require alias use +syn keyword elixirSelf self + syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' " This unfortunately also matches function names in function calls @@ -68,7 +70,7 @@ syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxf syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass -syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'" +syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'|\\\\" syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop @@ -160,6 +162,7 @@ hi def link elixirPseudoVariable Constant hi def link elixirAlias Type hi def link elixirBoolean Boolean hi def link elixirVariable Identifier +hi def link elixirSelf Identifier hi def link elixirUnusedVariable Comment hi def link elixirNumber Number hi def link elixirDocString String diff --git a/syntax/eruby.vim b/syntax/eruby.vim index c20b086b..4e175bcc 100644 --- a/syntax/eruby.vim +++ b/syntax/eruby.vim @@ -22,7 +22,7 @@ elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') if b:eruby_subtype == '' - let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$') endif if b:eruby_subtype == 'rhtml' let b:eruby_subtype = 'html' diff --git a/syntax/go.vim b/syntax/go.vim index 59f72ed7..4ee39a71 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -10,7 +10,9 @@ " let OPTION_NAME = 0 " in your ~/.vimrc file to disable particular options. You can also write: " let OPTION_NAME = 1 -" to enable particular options. At present, all options default to on. +" to enable particular options. +" At present, all options default to on, except highlight of: +" functions, methods and structs. " " - go_highlight_array_whitespace_error " Highlights white space after "[]". @@ -107,10 +109,10 @@ syn match goDeclaration /\/ " Predefined functions and values syn keyword goBuiltins append cap close complex copy delete imag len syn keyword goBuiltins make new panic print println real recover -syn keyword goConstants iota true false nil +syn keyword goBoolean iota true false nil hi def link goBuiltins Keyword -hi def link goConstants Keyword +hi def link goBoolean Boolean " Comments; their contents syn keyword goTodo contained TODO FIXME XXX BUG @@ -141,9 +143,11 @@ hi def link goEscapeError Error syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup syn region goRawString start=+`+ end=+`+ +syn match goFormatSpecifier /%[#0\-\ \+\*]*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString hi def link goString String hi def link goRawString String +hi def link goFormatSpecifier goSpecialString " Characters; their contents syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU @@ -199,7 +203,7 @@ endif " Extra types commonly seen if g:go_highlight_extra_types != 0 syn match goExtraType /\/ - syn match goExtraType /\/ + syn match goExtraType /\/ syn match goExtraType /\/ syn match goExtraType /\/ endif diff --git a/syntax/html.vim b/syntax/html.vim index 78da84f0..3e9beea4 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -24,6 +24,7 @@ syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data syn keyword htmlTagName contained template content shadow syn keyword htmlTagName contained wbr bdi +syn keyword htmlTagName contained picture " SVG tags " http://www.w3.org/TR/SVG/ @@ -75,6 +76,8 @@ syn keyword htmlArg contained label icon open datetime pubdate syn keyword htmlArg contained async " syn keyword htmlArg contained select +" +syn keyword htmlArg contained srcset sizes " Custom Data Attributes " http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data diff --git a/syntax/javascript.vim b/syntax/javascript.vim index 7d27707e..beb6b527 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -35,6 +35,7 @@ syntax keyword jsOperator delete instanceof typeof void new in syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/ syntax keyword jsBooleanTrue true syntax keyword jsBooleanFalse false +syntax keyword jsCommonJS require module exports "" JavaScript comments syntax keyword jsCommentTodo TODO FIXME XXX TBD contained @@ -55,15 +56,15 @@ if !exists("javascript_ignore_javaScriptdoc") syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold " tags containing a param - syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite + syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite " tags containing type and param syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite " tags containing type but no param - syntax match jsDocTags contained "@\(callback\|enum\|external\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite + syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite " tags containing references syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite " other tags (no extra syntax) - syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|event\|example\|file[oO]verview\|function\|global\|ignore\|inner\|instance\|license\|method\|mixin\|overview\|private\|protected\|public\|readonly\|since\|static\|todo\|summary\|undocumented\|virtual\)\>" + syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>" syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite @@ -81,9 +82,9 @@ syntax case match syntax match jsFuncCall /\k\+\%(\s*(\)\@=/ syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained syntax match jsTemplateVar "\${.\{-}}" contained -syntax region jsStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=jsSpecial,@htmlPreproc,@Spell -syntax region jsStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=jsSpecial,@htmlPreproc,@Spell -syntax region jsTemplateString start=+`+ skip=+\\\\\|\\$`+ end=+`+ contains=jsTemplateVar,jsSpecial,@htmlPreproc +syntax region jsStringD start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@htmlPreproc,@Spell +syntax region jsStringS start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@htmlPreproc,@Spell +syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`\|$+ contains=jsTemplateVar,jsSpecial,@htmlPreproc syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained @@ -91,7 +92,7 @@ syntax match jsRegexpQuantifier "\v\\@]" contained syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod -syntax region jsRegexpGroup start="\\\@\|\<0[xX]\x\+\>/ syntax keyword jsNumber Infinity @@ -99,28 +100,19 @@ syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+- syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\)\@=/ contains=jsFunctionKey contained syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\s*function\s*\)\@=/ contained -if g:javascript_conceal == 1 - syntax keyword jsNull null conceal cchar=ø - syntax keyword jsThis this conceal cchar=@ - syntax keyword jsReturn return conceal cchar=⇚ - syntax keyword jsUndefined undefined conceal cchar=¿ - syntax keyword jsNan NaN conceal cchar=ℕ - syntax keyword jsPrototype prototype conceal cchar=¶ -else - syntax keyword jsNull null - syntax keyword jsThis this - syntax keyword jsReturn return - syntax keyword jsUndefined undefined - syntax keyword jsNan NaN - syntax keyword jsPrototype prototype -endif +exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '') +exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '') +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 : '') +exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '') "" Statement Keywords syntax keyword jsStatement break continue with syntax keyword jsConditional if else switch syntax keyword jsRepeat do while for syntax keyword jsLabel case default -syntax keyword jsKeyword yield +syntax keyword jsKeyword yield import export default extends class syntax keyword jsException try catch throw finally syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object RegExp String Proxy ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window @@ -130,7 +122,7 @@ syntax keyword jsExceptions Error EvalError InternalError RangeError Referen syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval -syntax keyword jsFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public +syntax keyword jsFutureKeys abstract enum int short boolean interface static byte long super char final native synchronized float package throws goto private transient debugger implements protected volatile double public "" DOM/HTML/CSS specified things @@ -182,7 +174,7 @@ endif "DOM/HTML/CSS "" Code blocks -syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise +syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold @@ -202,11 +194,7 @@ if main_syntax == "javascript" syntax sync match jsHighlight grouphere jsBlock /{/ endif -if g:javascript_conceal == 1 - syntax match jsFunction /\/ nextgroup=jsFuncName,jsFuncArgs skipwhite conceal cchar=ƒ -else - syntax match jsFunction /\/ nextgroup=jsFuncName,jsFuncArgs skipwhite -endif +exe 'syntax match jsFunction /\/ nextgroup=jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '') syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty @@ -291,6 +279,7 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsExceptions Special HiLink jsFutureKeys Special HiLink jsBuiltins Special + HiLink jsCommonJS Include HiLink jsDomErrNo Constant HiLink jsDomNodeConsts Constant diff --git a/syntax/mustache.vim b/syntax/mustache.vim index 8f1d0a0f..ec7d4fe5 100644 --- a/syntax/mustache.vim +++ b/syntax/mustache.vim @@ -50,8 +50,8 @@ syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@h syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection -syntax region mustacheComment start=/{{!/rs=s+2 end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer -syntax region mustacheBlockComment start=/{{!--/rs=s+2 end=/--}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer +syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer +syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=mustacheInside,@htmlMustacheContainer syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside diff --git a/syntax/rust.vim b/syntax/rust.vim index 25d3b4bf..0c7dcb8b 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -17,7 +17,7 @@ syn keyword rustConditional match if else syn keyword rustOperator as syn match rustAssert "\= 508 || !exists("did_typeScript_syn_inits") HiLink typeScriptIdentifier Identifier HiLink typeScriptRepeat Repeat HiLink typeScriptStatement Statement - HiLink typeScriptFuncKeyword Function + HiLink typeScriptFuncKeyword Type HiLink typeScriptMessage Keyword HiLink typeScriptDeprecated Exception HiLink typeScriptError Error -- cgit v1.2.3