diff options
Diffstat (limited to 'syntax')
-rw-r--r-- | syntax/erlang.vim | 4 | ||||
-rw-r--r-- | syntax/gitconfig.vim | 2 | ||||
-rw-r--r-- | syntax/javascript.vim | 2 | ||||
-rw-r--r-- | syntax/rst.vim | 11 | ||||
-rw-r--r-- | syntax/rust.vim | 11 | ||||
-rw-r--r-- | syntax/scss.vim | 2 | ||||
-rw-r--r-- | syntax/svelte.vim | 3 | ||||
-rw-r--r-- | syntax/terraform.vim | 11 |
8 files changed, 38 insertions, 8 deletions
diff --git a/syntax/erlang.vim b/syntax/erlang.vim index 1c549969..391ad1b3 100644 --- a/syntax/erlang.vim +++ b/syntax/erlang.vim @@ -6,7 +6,7 @@ endif " Language: Erlang (http://www.erlang.org) " Maintainer: Csaba Hoch <csaba.hoch@gmail.com> " Contributor: Adam Rutkowski <hq@mtod.org> -" Last Update: 2017-Mar-05 +" Last Update: 2019-Jun-18 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -121,7 +121,7 @@ syn keyword erlangBIF garbage_collect get get_keys group_leader contained syn keyword erlangBIF halt hd integer_to_binary integer_to_list contained syn keyword erlangBIF iolist_to_binary iolist_size is_alive contained syn keyword erlangBIF is_atom is_binary is_bitstring is_boolean contained -syn keyword erlangBIF is_float is_function is_integer is_list is_map contained +syn keyword erlangBIF is_float is_function is_integer is_list is_map is_map_key contained syn keyword erlangBIF is_number is_pid is_port is_process_alive contained syn keyword erlangBIF is_record is_reference is_tuple length link contained syn keyword erlangBIF list_to_atom list_to_binary contained diff --git a/syntax/gitconfig.vim b/syntax/gitconfig.vim index 438cceae..80ee7971 100644 --- a/syntax/gitconfig.vim +++ b/syntax/gitconfig.vim @@ -34,7 +34,7 @@ hi def link gitconfigBoolean Boolean hi def link gitconfigNumber Number hi def link gitconfigString String hi def link gitconfigDelim Delimiter -hi def link gitconfigEscape Delimiter +hi def link gitconfigEscape Special hi def link gitconfigError Error let b:current_syntax = "gitconfig" diff --git a/syntax/javascript.vim b/syntax/javascript.vim index a48c58e2..0c917b68 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -65,7 +65,7 @@ syntax match jsFloat /\c\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%(e[+-]\= " Regular Expressions syntax match jsSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)" syntax region jsTemplateExpression contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression keepend -syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ contains=jsSpecial +syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ contains=jsSpecial extend syntax match jsRegexpBoundary contained "\v\c[$^]|\\b" syntax match jsRegexpBackRef contained "\v\\[1-9]\d*" syntax match jsRegexpQuantifier contained "\v[^\\]%([?*+]|\{\d+%(,\d*)?})\??"lc=1 diff --git a/syntax/rst.vim b/syntax/rst.vim index a875a44b..43b17aa8 100644 --- a/syntax/rst.vim +++ b/syntax/rst.vim @@ -94,7 +94,14 @@ execute 'syn match rstSubstitutionDefinition contained' . \ ' /|.*|\_s\+/ nextgroup=@rstDirectives' function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right) - execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.a:start.'+'.' contained' + " Only escape the first char of a multichar delimiter (e.g. \* inside **) + if a:start[0] == '\' + let first = a:start[0:1] + else + let first = a:start[0] + endif + + execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.first.'+'.' contained' execute 'syn region rst' . a:name . \ ' start=+' . a:char_left . '\zs' . a:start . @@ -170,7 +177,7 @@ syn match rstStandaloneHyperlink contains=@NoSpell \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]" syn region rstCodeBlock contained matchgroup=rstDirective - \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+ + \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+ \ skip=+^$+ \ end=+^\z1\@!+ \ contains=@NoSpell diff --git a/syntax/rust.vim b/syntax/rust.vim index 6f653014..a4fff5c2 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -153,7 +153,16 @@ syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustE syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell -syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError +" Match attributes with either arbitrary syntax or special highlighting for +" derives. We still highlight strings and comments inside of the attribute. +syn region rustAttribute start="#!\?\[" end="\]" contains=@rustAttributeContents,rustAttributeParenthesizedParens,rustAttributeParenthesizedCurly,rustAttributeParenthesizedBrackets,rustDerive +syn region rustAttributeParenthesizedParens matchgroup=rustAttribute start="\w\%(\w\)*("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents +syn region rustAttributeParenthesizedCurly matchgroup=rustAttribute start="\w\%(\w\)*{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents +syn region rustAttributeParenthesizedBrackets matchgroup=rustAttribute start="\w\%(\w\)*\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents +syn region rustAttributeBalancedParens matchgroup=rustAttribute start="("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents +syn region rustAttributeBalancedCurly matchgroup=rustAttribute start="{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents +syn region rustAttributeBalancedBrackets matchgroup=rustAttribute start="\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents +syn cluster rustAttributeContents contains=rustString,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait " This list comes from src/libsyntax/ext/deriving/mod.rs " Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show). diff --git a/syntax/scss.vim b/syntax/scss.vim index 84f75fea..69574735 100644 --- a/syntax/scss.vim +++ b/syntax/scss.vim @@ -50,6 +50,7 @@ syn cluster scssSelectors contains=@comment,cssSelectorOp,cssTagName,cssPseudoCl syn match scssProperty "\([[:alnum:]-]\)\+\s*\(:\)\@=" contained contains=css.*Prop,cssVendor containedin=cssMediaBlock nextgroup=scssAttribute,scssAttributeWithNestedDefinition syn match scssAttribute ":[^;]*\ze\(;\|}\)" contained contains=css.*Attr,cssValue.*,cssColor,cssFunction,cssString.*,cssURL,scssFunction,scssInterpolation,scssVariable +syn match scssSemicolon ";" containedin=scssDefinition,scssNestedDefinition syn match scssAttributeWithNestedDefinition ": [^#"]*{\@=" nextgroup=scssNestedDefinition contained contains=css.*Attr,cssValue.*,scssVariable syn region scssNestedDefinition matchgroup=cssBraces start="{" end="}" contained contains=@comment,scssProperty,scssNestedProperty @@ -218,6 +219,7 @@ hi def link scssImport Include hi def link scssTodo Todo hi def link scssAtRoot Keyword hi def link scssMapParens Delimiter +hi def link scssSemicolon Delimiter let b:current_syntax = "scss" if main_syntax == 'scss' diff --git a/syntax/svelte.vim b/syntax/svelte.vim index e119d605..2149e71a 100644 --- a/syntax/svelte.vim +++ b/syntax/svelte.vim @@ -48,7 +48,10 @@ syntax match svelteKeyword "#await" contained containedin=jsBlock,javascriptBloc syntax match svelteKeyword "/await" contained containedin=jsBlock,javascriptBlock syntax match svelteKeyword ":catch" contained containedin=jsBlock,javascriptBlock syntax match svelteKeyword ":then" contained containedin=jsBlock,javascriptBlock + +" Inline keywords. syntax match svelteKeyword "@html" contained containedin=jsBlock,javascriptBlock +syntax match svelteKeyword "@debug" contained containedin=jsBlock,javascriptBlock " Repeat functions. syntax match svelteRepeat "#each" contained containedin=jsBlock,javascriptBlock diff --git a/syntax/terraform.vim b/syntax/terraform.vim index eb7745e7..58c60203 100644 --- a/syntax/terraform.vim +++ b/syntax/terraform.vim @@ -9,6 +9,12 @@ if exists('b:current_syntax') finish endif +" Identifiers are made up of alphanumeric characters, underscores, and +" hyphens. +if has('patch-7.4.1142') + syn iskeyword a-z,A-Z,48-57,_,- +endif + syn case match syn keyword terraSection connection output provider variable data terraform locals @@ -3732,7 +3738,7 @@ syn region terraDynamicName start=/"/ end=/"/ nextgroup=terraDynamicBlock skipwh """ misc. syn match terraValueDec "\<[0-9]\+\([kKmMgG]b\?\)\?\>" syn match terraValueHexaDec "\<0x[0-9a-f]\+\([kKmMgG]b\?\)\?\>" -syn match terraBraces "[{}\[\]]" +syn match terraBraces "[\[\]]" """ skip \" in strings. """ we may also want to pass \\" into a function to escape quotes. @@ -3757,6 +3763,9 @@ syn keyword terraValueNull null """ Terraform v0.12 syn keyword terraTodo contained TF-UPGRADE-TODO +" enable block folding +syn region terraBlock matchgroup=terraBraces start="{" end="}" fold transparent + hi def link terraComment Comment hi def link terraTodo Todo hi def link terraBrackets Operator |