diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-05 22:47:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-05 22:47:25 +0100 |
commit | c08ee7476b19f9b4de5df287797af87c4e3fba0a (patch) | |
tree | 2e62f5130c143d521d8155dbf79038047e6b33fe /runtime/syntax | |
parent | e38eab22c1fb950127f0307a9904de6d4561dc70 (diff) | |
download | vim-git-c08ee7476b19f9b4de5df287797af87c4e3fba0a.tar.gz |
Update runtime files.
Diffstat (limited to 'runtime/syntax')
-rw-r--r-- | runtime/syntax/git.vim | 8 | ||||
-rw-r--r-- | runtime/syntax/gitcommit.vim | 15 | ||||
-rw-r--r-- | runtime/syntax/gitconfig.vim | 10 | ||||
-rw-r--r-- | runtime/syntax/gitrebase.vim | 35 | ||||
-rw-r--r-- | runtime/syntax/haml.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/markdown.vim | 66 | ||||
-rw-r--r-- | runtime/syntax/sass.vim | 11 | ||||
-rw-r--r-- | runtime/syntax/scss.vim | 11 |
8 files changed, 106 insertions, 54 deletions
diff --git a/runtime/syntax/git.vim b/runtime/syntax/git.vim index 48264c7bf..a8467edd4 100644 --- a/runtime/syntax/git.vim +++ b/runtime/syntax/git.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: generic git output " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2010 May 21 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -13,7 +13,7 @@ syn sync minlines=50 syn include @gitDiff syntax/diff.vim syn region gitHead start=/\%^/ end=/^$/ -syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/ +syn region gitHead start=/\%(^commit\%( \x\{40\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/ " For git reflog and git show ...^{tree}, avoid sync issues syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/ @@ -25,12 +25,14 @@ 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 syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite -syn match gitMode /^\d\{6\}/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite +syn match gitMode /^\d\{6\}\>/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite diff --git a/runtime/syntax/gitcommit.vim b/runtime/syntax/gitcommit.vim index 5e0642fbc..63b1ce920 100644 --- a/runtime/syntax/gitcommit.vim +++ b/runtime/syntax/gitcommit.vim @@ -2,7 +2,7 @@ " Language: git commit file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.git/COMMIT_EDITMSG -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -18,11 +18,18 @@ endif syn include @gitcommitDiff syntax/diff.vim syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff -syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl -syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell +syn match gitcommitSummary "^.*\%<51v." contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell syn match gitcommitOverflow ".*" contained contains=@Spell syn match gitcommitBlank "^[^#].*" contained contains=@Spell -syn match gitcommitComment "^#.*" + +if get(g:, "gitcommit_cleanup") is# "scissors" + syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank skipnl + syn region gitcommitComment start=/^# -\+ >8 -\+$/ end=/\%$/ contains=gitcommitDiff +else + syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl + syn match gitcommitComment "^#.*" +endif + syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite diff --git a/runtime/syntax/gitconfig.vim b/runtime/syntax/gitconfig.vim index 668764eac..e5eaf10f9 100644 --- a/runtime/syntax/gitconfig.vim +++ b/runtime/syntax/gitconfig.vim @@ -2,24 +2,22 @@ " Language: git config file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: gitconfig, .gitconfig, *.git/config -" Last Change: 2019 Sep 27 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish endif -setlocal iskeyword+=- -setlocal iskeyword-=_ syn case ignore syn sync minlines=10 syn match gitconfigComment "[#;].*" contains=@Spell syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]" syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]' -syn match gitconfigVariable "\%(^\s*\)\@<=\a\k*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite +syn match gitconfigVariable "\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite syn region gitconfigAssignment matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend syn keyword gitconfigBoolean true false yes no contained -syn match gitconfigNumber "\d\+" contained +syn match gitconfigNumber "\<\d\+\>" contained syn region gitconfigString matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError syn match gitconfigError +\\.+ contained syn match gitconfigEscape +\\[\\"ntb]+ contained @@ -32,7 +30,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/runtime/syntax/gitrebase.vim b/runtime/syntax/gitrebase.vim index a944c14dd..1ec2b5904 100644 --- a/runtime/syntax/gitrebase.vim +++ b/runtime/syntax/gitrebase.vim @@ -2,7 +2,7 @@ " Language: git rebase --interactive " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: git-rebase-todo -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -10,31 +10,48 @@ endif syn case match -syn match gitrebaseHash "\v<\x{7,40}>" contained -syn match gitrebaseCommit "\v<\x{7,40}>" nextgroup=gitrebaseSummary skipwhite +syn match gitrebaseHash "\v<\x{7,}>" contained +syn match gitrebaseCommit "\v<\x{7,}>" nextgroup=gitrebaseSummary skipwhite syn match gitrebasePick "\v^p%(ick)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite +syn match gitrebaseBreak "\v^b%(reak)=>" syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseNoop "\v^noop>" +syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,gitrebaseName skipwhite +syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite +syn match gitrebaseReset "\v^r(eset)=>" nextgroup=gitrebaseName skipwhite syn match gitrebaseSummary ".*" contains=gitrebaseHash contained syn match gitrebaseCommand ".*" contained -syn match gitrebaseComment "^#.*" contains=gitrebaseHash +syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseMergeOption "\v-[Cc]>" nextgroup=gitrebaseMergeCommit skipwhite contained +syn match gitrebaseMergeCommit "\v<\x{7,}>" nextgroup=gitrebaseName skipwhite contained +syn match gitrebaseName "\v[^[:space:].*?i:^~/-]\S+" nextgroup=gitrebaseMergeComment skipwhite contained +syn match gitrebaseMergeComment "#" nextgroup=gitrebaseSummary skipwhite contained hi def link gitrebaseCommit gitrebaseHash hi def link gitrebaseHash Identifier -hi def link gitrebasePick Statement -hi def link gitrebaseReword Number +hi def link gitrebasePick Type +hi def link gitrebaseReword Conditional hi def link gitrebaseEdit PreProc -hi def link gitrebaseSquash Type -hi def link gitrebaseFixup Special -hi def link gitrebaseExec Function +hi def link gitrebaseSquash Statement +hi def link gitrebaseFixup Repeat +hi def link gitrebaseExec Operator +hi def link gitrebaseBreak Macro hi def link gitrebaseDrop Comment +hi def link gitrebaseNoop Comment +hi def link gitrebaseMerge Exception +hi def link gitrebaseLabel Label +hi def link gitrebaseReset Keyword hi def link gitrebaseSummary String hi def link gitrebaseComment Comment hi def link gitrebaseSquashError Error +hi def link gitrebaseMergeCommit gitrebaseCommit +hi def link gitrebaseMergeComment gitrebaseComment +hi def link gitrebaseName Tag let b:current_syntax = "gitrebase" diff --git a/runtime/syntax/haml.vim b/runtime/syntax/haml.vim index 5369695c2..c14b88f50 100644 --- a/runtime/syntax/haml.vim +++ b/runtime/syntax/haml.vim @@ -2,7 +2,7 @@ " Language: Haml " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.haml -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -38,7 +38,7 @@ syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser, syn match hamlSelfCloser "/" contained syn match hamlClassChar "\." contained nextgroup=hamlClass syn match hamlIdChar "#{\@!" contained nextgroup=hamlId -syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent +syn match hamlClass "\%(\w\|-\|\:\)\+" contained nextgroup=@hamlComponent syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent syn region hamlDocType start="^\s*!!!" end="$" diff --git a/runtime/syntax/markdown.vim b/runtime/syntax/markdown.vim index 1955a7443..0321ca3ce 100644 --- a/runtime/syntax/markdown.vim +++ b/runtime/syntax/markdown.vim @@ -2,7 +2,7 @@ " Language: Markdown " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.markdown -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -18,37 +18,46 @@ unlet! b:current_syntax if !exists('g:markdown_fenced_languages') let g:markdown_fenced_languages = [] endif +let s:done_include = {} for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")') + if has_key(s:done_include, matchstr(s:type,'[^.]*')) + continue + endif if s:type =~ '\.' let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') endif exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' unlet! b:current_syntax + let s:done_include[matchstr(s:type,'[^.]*')] = 1 endfor unlet! s:type +unlet! s:done_include -syn sync minlines=10 +if !exists('g:markdown_minlines') + let g:markdown_minlines = 50 +endif +execute 'syn sync minlines=' . g:markdown_minlines syn case ignore -syn match markdownValid '[<>]\c[a-z/$!]\@!' -syn match markdownValid '&\%(#\=\w*;\)\@!' +syn match markdownValid '[<>]\c[a-z/$!]\@!' transparent contains=NONE +syn match markdownValid '&\%(#\=\w*;\)\@!' transparent contains=NONE syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule -syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError +syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError,markdownValid syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink syn match markdownHeadingRule "^[=-]\+$" contained -syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH1 matchgroup=markdownH1Delimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH2 matchgroup=markdownH2Delimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH3 matchgroup=markdownH3Delimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH4 matchgroup=markdownH4Delimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH5 matchgroup=markdownH5Delimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH6 matchgroup=markdownH6Delimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock @@ -70,31 +79,40 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained -syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart +syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline -let s:concealends = has('conceal') ? ' concealends' : '' -exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends -exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends -exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart' . s:concealends +let s:concealends = '' +if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1 + let s:concealends = ' concealends' +endif +exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" skip="\\*" contains=markdownLineStart,@Spell' . s:concealends +exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\w\@<!_\S\@=" end="\S\@<=_\w\@!" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends +exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" skip="\\*" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends +exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\w\@<!__\S\@=" end="\S\@<=__\w\@!" skip="\\_" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends +exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" skip="\\*" contains=markdownLineStart,@Spell' . s:concealends +exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\w\@<!___\S\@=" end="\S\@<=___\w\@!" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart -syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend +syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*````*.*$" end="^\s*````*\ze\s*$" keepend syn match markdownFootnote "\[^[^\]]\+\]" syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:" if main_syntax ==# 'markdown' + let s:done_include = {} for s:type in g:markdown_fenced_languages - exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') + if has_key(s:done_include, matchstr(s:type,'[^.]*')) + continue + endif + exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*````*\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*````*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends + let s:done_include[matchstr(s:type,'[^.]*')] = 1 endfor unlet! s:type + unlet! s:done_include endif syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]" @@ -107,6 +125,12 @@ hi def link markdownH4 htmlH4 hi def link markdownH5 htmlH5 hi def link markdownH6 htmlH6 hi def link markdownHeadingRule markdownRule +hi def link markdownH1Delimiter markdownHeadingDelimiter +hi def link markdownH2Delimiter markdownHeadingDelimiter +hi def link markdownH3Delimiter markdownHeadingDelimiter +hi def link markdownH4Delimiter markdownHeadingDelimiter +hi def link markdownH5Delimiter markdownHeadingDelimiter +hi def link markdownH6Delimiter markdownHeadingDelimiter hi def link markdownHeadingDelimiter Delimiter hi def link markdownOrderedListMarker markdownListMarker hi def link markdownListMarker htmlTagName diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim index d075c8736..b51a0ae26 100644 --- a/runtime/syntax/sass.vim +++ b/runtime/syntax/sass.vim @@ -2,7 +2,7 @@ " Language: Sass " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.sass -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -21,8 +21,7 @@ syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation -syn match sassDefault "!default\>" contained -syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+" +syn match sassFlag "!\%(default\|global\|optional\)\>" contained syn match sassVariable "$[[:alnum:]_-]\+" syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite @@ -42,7 +41,6 @@ syn match sassMixin "\%([{};]\s*\|^\s*\)\@<=@mixin" nextgroup=sassMixinName s syn match sassMixing "^\s\+\zs+" nextgroup=sassMixinName syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend" -syn match sassPlaceholder "\%([{};]\s*\|^\s*\)\@<=%" nextgroup=sassMixinName skipwhite syn match sassFunctionName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute syn match sassFunctionDecl "\%([{};]\s*\|^\s*\)\@<=@function" nextgroup=sassFunctionName skipwhite @@ -52,6 +50,7 @@ syn match sassEscape "^\s*\zs\\" syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId syn match sassId "[[:alnum:]_-]\+" contained syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass +syn match sassPlaceholder "\%([{};]\s*\|^\s*\)\@<=%" nextgroup=sassClass syn match sassClass "[[:alnum:]_-]\+" contained syn match sassAmpersand "&" @@ -75,12 +74,12 @@ syn match sassEndOfLineComment "//.*" contains=sassComment,sassTodo,@Spell hi def link sassEndOfLineComment sassComment hi def link sassCssComment sassComment hi def link sassComment Comment -hi def link sassDefault cssImportant +hi def link sassFlag cssImportant hi def link sassVariable Identifier hi def link sassFunction Function hi def link sassMixing PreProc hi def link sassMixin PreProc -hi def link sassPlaceholder PreProc +hi def link sassPlaceholder sassClassChar hi def link sassExtend PreProc hi def link sassFunctionDecl PreProc hi def link sassReturn PreProc diff --git a/runtime/syntax/scss.vim b/runtime/syntax/scss.vim index 6fb969152..9d79dc5cb 100644 --- a/runtime/syntax/scss.vim +++ b/runtime/syntax/scss.vim @@ -2,7 +2,7 @@ " Language: SCSS " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.scss -" Last Change: 2010 Jul 26 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish @@ -10,10 +10,15 @@ endif runtime! syntax/sass.vim +syn clear sassComment +syn clear sassCssComment +syn clear sassEndOfLineComment + syn match scssComment "//.*" contains=sassTodo,@Spell -syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell +syn region scssCssComment start="/\*" end="\*/" contains=sassTodo,@Spell -hi def link scssComment sassComment +hi def link scssCssComment scssComment +hi def link scssComment Comment let b:current_syntax = "scss" |